nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH] Indicate open buffer count in title bar


From: Marco Diego Aurélio Mesquita
Subject: Re: [Nano-devel] [PATCH] Indicate open buffer count in title bar
Date: Thu, 31 Aug 2017 13:45:40 -0300

Hi Benno!

On Tue, Aug 29, 2017 at 4:29 PM, Benno Schulenberg <address@hidden> wrote:
>
> Hello Marco,
>
> Op 28-08-2017 om 23:29 schreef Marco Diego Aurélio Mesquita:
>>
>> Attached is a very simple patch to improve the multi-buffer feature in
>> nano. With the attached patch, nano displays the position of current
>> buffer (on the list of buffers) and the number of buffers.
>
>
> Interesting.  It doesn't work correctly yet, though: when you have
> just opened three files and then hit ^X, it will switch to the next
> buffer but it will still say: [2/3].  Only after a ^L will it say
> [1/2].
>

I'm not sure why this happens. Maybe it is because the buffer is only
removed after it is switched. I think forcing a screen update whenever
a buffer is removed can fix this. How can I do that? Do you know a
better approach?

> About the patch itself: I don't think it is guaranteed that memory
> allocations happen in sequence, so you can't just compare pointers
> to openfilestructs.  I would use a global variable (say: firstfile),
> and then use one and the same function to count the number of buffers
> (by passing firstfile_>prev) and to get the sequence number of the
> current buffer (by passing openfile).
>

I can do it. The firstfile global variable may need to be update
whenever a buffer is closed. Can you point me in the code where this
happens?

> Also, when this "[x/y]" is present in the title bar, I find the
> "File: " to be too much of a clutter.  I think it can be dropped
> completely -- this inheritance from Pico is no longer needed.
>

Seems easy.

>> It is quite quick and dirty right now, but my intention is to just get
>> feedback to arrive at something that can be accepted.
>
>
> For it to get accepted, there will have to be some response from
> other people, saying that they like and want this feature.
>

How can I get people to say so?


Thanks!

On Tue, Aug 29, 2017 at 4:29 PM, Benno Schulenberg <address@hidden> wrote:
>
> Hello Marco,
>
> Op 28-08-2017 om 23:29 schreef Marco Diego Aurélio Mesquita:
>>
>> Attached is a very simple patch to improve the multi-buffer feature in
>> nano. With the attached patch, nano displays the position of current
>> buffer (on the list of buffers) and the number of buffers.
>
>
> Interesting.  It doesn't work correctly yet, though: when you have
> just opened three files and then hit ^X, it will switch to the next
> buffer but it will still say: [2/3].  Only after a ^L will it say
> [1/2].
>
> About the patch itself: I don't think it is guaranteed that memory
> allocations happen in sequence, so you can't just compare pointers
> to openfilestructs.  I would use a global variable (say: firstfile),
> and then use one and the same function to count the number of buffers
> (by passing firstfile_>prev) and to get the sequence number of the
> current buffer (by passing openfile).
>
> Also, when this "[x/y]" is present in the title bar, I find the
> "File: " to be too much of a clutter.  I think it can be dropped
> completely -- this inheritance from Pico is no longer needed.
>
>> It is quite quick and dirty right now, but my intention is to just get
>> feedback to arrive at something that can be accepted.
>
>
> For it to get accepted, there will have to be some response from
> other people, saying that they like and want this feature.
>
>> If this feature is implemented, I plan, on the future, to implement a
>> fast switching between buffers.
>
>
> I will not accept that.  Switching between a handful or two handfuls
> of buffers is pretty fast with Alt+Left and Alt+Right.  And anyway,
> how is the user going to know which sequence number a specific file
> has?  There is no sidebar or tabbar that shows this number, so the
> user would have to memorize the numbers.  Using Alt+Left/Right is
> probably easier and quicker then.
>
>> Currently (AFAIK) you can only go
>> backward and forward with buffers in nano; I plan to implement
>> something so that the user can hit M-n and switch to the n-th buffer.
>
>
> M-3 and M-6 are already taken.  M-7, M-8, and M-9 too.  And needing
> more than one keystroke to switch to a specific buffer...  No.
>
> Benno
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]