|
From: | Mahyar Abbaspour |
Subject: | Re: [Nano-devel] [PATCH] Window resize handling |
Date: | Thu, 23 Apr 2015 16:18:22 +0430 |
> + /* Let the others know the handler has been executed */
> + sigwinch_flag = sigwinch_flag ? 0 : 1;
What if there were two SIGWINCHes during a blocking period?
Wouldn't it therefore be better to just do sigwinch_flag++?
Well, I can imagine the user doing ^J, then realize that the width is
wrong, then resizes the window, and then: "Darn, I forgot to unjustify
first." However... if it was really only the width that was wrong, the
user can do <Up> and hit ^J again to rejustify things with the new
width.
So... I will allow this tiny regression, [...]
By the way, your patch still doesn't compile. To achieve that (on my
system at least), you will have to move #include <signal.h> from nano.c
to nano.h.
There's one little awkwardness I've found while using your patch.
Run nano, hit ^G, then make the window some twenty columns
narrower, then hit <End>. You're not at the end of the help text.
And the other way around: hit ^G, make the window significantly
wider, then hit <End>. You find yourself in a blank expanse.
So... ideally your patch would rebuild the help screen when a
SIGWINCH has occurred. But if that's too diffiult/ugly/expensive
to make, I will let it pass: the user can hit ^G ^G to enter the
help screen again.
Oh, make that two awkwardnesses. Eh, no, make this a blocker.
Start nano, hit ^R ^T, then make the window so much narrower
that you lose at least one column of files and the directory requires
two pages to display. Then hit <PageDown>. Huh? It has skipped
a bunch of files. If you use <Down> instead, the cursor wil disappear
for a little while between the two pages. Conversely, when making
the window wider when in the file browser, and the number of
required pages is reduced, it will still display the original number
of pages, thus showing several files more than once. So also
the file list must be regenerated when a SIGWINCH occurs
while in the file browser.
[Prev in Thread] | Current Thread | [Next in Thread] |