commit f7f7767e7d8201d10f7ba7d31b909fbe29ae0881
parent 91155486c70255edea6beb599c6d07dcc8abe073
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 17 Oct 2018 20:17:03 +0200
display: let the title bar show when nano is in linting mode
This is a first step to address https://savannah.gnu.org/bugs/?54714.
Diffstat:
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -3173,7 +3173,10 @@ void do_linter(void)
return;
}
+ /* Show that we are in the linter now. */
+ titlebar(NULL);
bottombars(MLINTER);
+
tmplint = NULL;
curlint = lints;
@@ -3201,10 +3204,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);
@@ -3237,6 +3243,8 @@ void do_linter(void)
if (restlint == NULL) {
statusbar(_("No more errors in unopened files, cancelling"));
+ currmenu = MMOST;
+ titlebar(NULL);
napms(2400);
break;
} else {
@@ -3274,9 +3282,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
@@ -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:");