[Top][All Lists]

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

Re: [Nano-devel] [PATCH] display: first attempt at making --nohelp effec

From: Brand Huntsman
Subject: Re: [Nano-devel] [PATCH] display: first attempt at making --nohelp effective only in main menu
Date: Sat, 25 Aug 2018 22:58:34 -0600

On Fri, 24 Aug 2018 15:31:42 -0600
Brand Huntsman <address@hidden> wrote:

> > But it might also need to copy&free the saved message, because some
> > messages might be allocated and freed by caller.  
> And maybe have statusline() always set last_msg to null if MMAIN, to
> avoid copying messages that happen in editor.

I didn't realize statusline used varargs, the following saves the computed 
message and also saves importance so statusbar receives the correct color.

-   free(compound);
+   if (last_status_msg) free(last_status_msg);
+   if (currmenu == MMAIN) {
+       last_status_msg = NULL;
+       free(compound);
+   } else
+       last_status_msg = compound;
+   last_status_importance = importance;

But last_status_* need to be cleared when opening a prompt, otherwise an alert 
on statusbar will prevent the search cancelled message from appearing. And you 
probably don't care about whatever message was there before opening the prompt.

But if the cursor is on the bottom two rows of edit window, a prompt causes the 
edit window to scroll up two lines. Any scrolling should be undone when closing 
the prompt, because it is quite annoying. Or maybe don't enable help if 
scrolling is required, because the scrolling as prompt opens is also annoying.

reply via email to

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