nano-devel
[Top][All Lists]
Advanced

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

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


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH 1/2] display: let the title bar show when nano is in linting mode
Date: Wed, 17 Oct 2018 20:36:27 +0200

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

diff --git a/src/text.c b/src/text.c
index 3f1da94f..19932d4d 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,6 +3203,7 @@ 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) {
@@ -3273,9 +3277,11 @@ void do_linter(void)
                func = func_from_key(&kbinput);
                tmplint = curlint;
 
-               if (func == do_cancel)
+               if (func == do_cancel) {
+                       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 33fdde0a..0c2a7fa4 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]