nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] [PATCH 1/3] display: let the title bar show when nano is in


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH 1/3] display: let the title bar show when nano is in linting mode
Date: Sun, 21 Oct 2018 20:52:16 +0200

This is a first step to address https://savannah.gnu.org/bugs/?54714.
---
 src/text.c  | 14 ++++++++++++--
 src/winio.c |  6 ++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/text.c b/src/text.c
index 8a9d372e..4b1a13a6 100644
--- a/src/text.c
+++ b/src/text.c
@@ -3172,7 +3172,10 @@ void do_linter(void)
                return;
        }
 
+       /* Show that we are in the linter now. */
+       titlebar(NULL);
        bottombars(MLINTER);
+
        tmplint = NULL;
        curlint = lints;
 
@@ -3200,10 +3203,13 @@ void do_linter(void)
                                sprintf(msg, _("This message is for unopened 
file %s,"
                                                        " open it in a new 
buffer?"), curlint->filename);
                                i = do_yesno_prompt(FALSE, msg);
+                               currmenu = MLINTER;
                                free(msg);
 
                                if (i == -1) {
                                        statusbar(_("Cancelled"));
+                                       currmenu = MMOST;
+                                       titlebar(NULL);
                                        goto free_lints_and_return;
                                } else if (i == 1) {
                                        open_buffer(curlint->filename, TRUE);
@@ -3236,6 +3242,8 @@ void do_linter(void)
 
                                        if (restlint == NULL) {
                                                statusbar(_("No more errors in 
unopened files, cancelling"));
+                                               currmenu = MMOST;
+                                               titlebar(NULL);
                                                napms(2400);
                                                break;
                                        } else {
@@ -3273,9 +3281,11 @@ void do_linter(void)
                func = func_from_key(&kbinput);
                tmplint = curlint;
 
-               if (func == do_cancel || func == do_enter)
+               if (func == do_cancel || func == do_enter) {
+                       currmenu = MMOST;
+                       titlebar(NULL);
                        break;
-               else if (func == do_help_void) {
+               } else if (func == do_help_void) {
                        tmplint = NULL;
                        do_help_void();
                } else if (func == do_page_up || func == do_prev_block) {
diff --git a/src/winio.c b/src/winio.c
index 7f8a4e00..daab6b82 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -2069,6 +2069,12 @@ void titlebar(const char *path)
         * then sacrifice the prefix, and only then start dottifying. */
 
        /* Figure out the path, prefix and state strings. */
+#ifdef ENABLE_COLOR
+       if (currmenu == MLINTER) {
+               prefix = _("Linting --");
+               path = openfile->filename;
+       } else
+#endif
 #ifdef ENABLE_BROWSER
        if (!inhelp && path != NULL)
                prefix = _("DIR:");
-- 
2.19.1




reply via email to

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