Re: [code] [textadept] Tab bar: labels shown; reordering

From: Mitchell <m.att.foicica.com>
Date: Tue, 18 Sep 2018 09:39:58 -0400 (EDT)

Hi Lukas,

On Tue, 18 Sep 2018, Procházka Lukáš Ing. wrote:

> Hello,
>
> On Tue, 18 Sep 2018 15:10:57 +0200, Mitchell <m.att.foicica.com> wrote:
>
>> Hi Lukas,
>>
>> On Tue, 18 Sep 2018, Procházka Lukáš Ing. wrote:
>>
>>> Hello,
>>>
>>> 1.
>>>
>>> when I create a new buffer by
>>>
>>> local buf = buffer.new(); buf._type = "test"
>>>
>>> a new tab with the label "Untitled" appears in the tab bar.
>>> And only when I click another tab and back the last tab, the buffer name
>>> "test" is shown in the tab bar.
>>>
>>> What function (event) should I call (emit) to tell the tab bar to
>>> show/refresh the buffer label (be it ._type or .filename or another
>>> member)?
>>
>> Try calling `events.emit(events.UPDATE_UI)`.
>
> I tried (text written into the command prompt Ctrl+E):
>
> local buf = buffer.new(); buf._type = "test";
> events.emit(events.UPDATE_UI)
>
> and also
>
> (function() local buf = buffer.new(); buf._type = "test";
> events.emit(events.UPDATE_UI) end)()
>
> but neither one works: new tab "Untitled" appears but it is not relabeled to
> "test".

Gah, sorry. Bad memory on my part. Try `events.BUFFER_NEW` or `events.BUFFER_AFTER_SWITCH`. I'm not exactly sure of the side effects for each, but I'd imagine either would be fine.

>>> 2.
>>>
>>> Is it possible to reorder buffers show in the tab bar? I'd like buffers
>>> '[...]' be shown first, so e.g. let's have buffers:
>>>
>>> File2.txt | [Message Buffer] | File1.txt | [My Debug Buffer] ... (opened
>>> in
>>> this order)
>>>
>>> and to be reordered into:
>>>
>>> [Message Buffer] | [My Debug Buffer] | File1.txt | File2.txt ... (new
>>> order)
>>
>> Sorry, this is not possible at the moment.
>
> (OK - it would be nice in the future.)

I agree. It's been on my TODO list for a while.

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 18 Sep 2018 - 09:39:58 EDT

This archive was generated by hypermail 2.2.0 : Wed 19 Sep 2018 - 06:55:12 EDT