nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] [PATCH] Window resize handling


From: Mahyar Abbaspour
Subject: Re: [Nano-devel] [PATCH] Window resize handling
Date: Wed, 22 Apr 2015 20:30:11 +0430

Thanks for your comments on the patch. I fixed the issues you mentioned in the previous post including indentations. You can find the second version of the patch attached.

On Wed, Apr 22, 2015 at 1:26 PM, Benno Schulenberg <address@hidden> wrote:

Hi Mahyar,

Some nitpicks:

> +     if (kbinput == KEY_WINCH) {
> +         browser_refresh();
> +             old_selected = selected;

This last one seems superfluous, as it was done just seven lines
earlier.
 
Yes, you're right. I have fixed it in my newer patch.


(Also, please use four spaces for the first, third, fifth level indent;
it's not all tabs everywhere.  Use M-P to see the difference.)

Sorry for inconvenience.
 
> --- src/text.c        (revision 5213)
> +++ src/text.c        (working copy)
> @@ -2207,15 +2207,6 @@
>
>      edit_refresh();
>
> -#ifndef NANO_TINY
> -    /* We're going to set jump_buf so that we return here after a
> -     * SIGWINCH instead of to main().  Indicate this. */
> -    jump_buf_main = FALSE;
> -
> -    /* Return here after a SIGWINCH. */
> -    sigsetjmp(jump_buf, 1);
> -#endif

Well... removing this breaks the special case for Unjustify:
right after a ^J it is possible to do an unjustify with ^U.
With your patch it is no longer possible to unjustify when
a window resize took place right after the ^J.  With current
nano this works fine.  (True, a highly unlikely scenario,
but...).
 
As you have mentioned, it is very unlikely since SIGWINCH is generated by the user, so I thought it's unnecessary and actually breaks the normal flow of the program.

 
>      /* Read in a character and interpret it.  Continue doing this until
>       * we get a recognized value or sequence. */
> -    while ((kbinput = parse_kbinput(win)) == ERR)
> -     ;
> +     do {
> +             kbinput = parse_kbinput(win);
> +     } while (kbinput == ERR
> +#ifndef NANO_TINY
> +                     && kbinput != KEY_WINCH
> +#endif
> +                     );

Hm?  I don't see what the "&& kbinput != KEY_WINCH" brings.
When kbinput == ERR it necessarily means it isn't anything else.
 
Oops! yes it's definitely redundant. I changed the do-while block back to its original form.


--

Mahyar

Attachment: window_resize-2.patch
Description: Text Data


reply via email to

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