nano-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] state flag related modifications


From: Benno Schulenberg
Subject: Re: [PATCH] state flag related modifications
Date: Mon, 21 Dec 2020 15:16:05 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Op 21-12-2020 om 07:16 schreef ObeliX:
> [...] thus wmove() returned an error and did not
> change the cursor position, causing that state info was directly
> appended to path.

Ouch.  That is a serious display bug.  I've re-reported it here:

  https://savannah.gnu.org/bugs/?59744

(Please in future report any issue on Savannah.  That's where
bug reports go.)

> the minimalistic fix is, to print the state info only, when
> stateflag string was initialized to a size bigger than 2.
> because in browser mode statelen is 2 or 0 (depending if
> right border spaces are included or not).

Or simply check that 'state' is not an empty string.

> --- a/src/winio.c
> +++ b/src/winio.c
> @@ -2007,7 +2007,7 @@ void titlebar(const char *path)
>       if (ISSET(STATEFLAGS) && !ISSET(VIEW_MODE)) {
>               if (openfile->modified && COLS > 1)
>                       waddstr(topwin, " *");
> -             if (statelen < COLS) {
> +             if (statelen > 2 && statelen < COLS) {

The check needs to happen earlier, because also the asterisk
needs to be suppressed in the file browser and help viewer.

I've applied this fix:

  https://git.savannah.gnu.org/cgit/nano.git/commit/?id=5c4c30e2

Thanks for (indirectly) reporting the bug, plus the proposed fix.
(I'm amazed that no one else had reported this yet -- apparently
very few people use the browser or help.)

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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