From 477f63d8b5084acb5be0636738dfe524e82db8f7 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 24 Oct 2018 10:23:39 +0200 Subject: [PATCH] linter: do not pause when there are no messages for unopened files Return immediately to editing mode when there are no messages for the original file and the user does not wish to open any of the included files that do have messages. Also, reword the message that the linter gives then, and leave it on the status bar (just like when Cancel is pressed). --- src/text.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/text.c b/src/text.c index cd883fda..8302c7dd 100644 --- a/src/text.c +++ b/src/text.c @@ -3215,9 +3215,7 @@ void do_linter(void) if (i == -1) { statusbar(_("Cancelled")); - currmenu = MMOST; - titlebar(NULL); - goto free_lints_and_return; + break; } else if (i == 1) { open_buffer(curlint->filename, TRUE); } else { @@ -3248,10 +3246,7 @@ void do_linter(void) free(dontwantfile); if (restlint == NULL) { - statusbar(_("No more errors in unopened files, cancelling")); - currmenu = MMOST; - titlebar(NULL); - napms(2400); + statusbar(_("No messages for this file")); break; } else { curlint = restlint; @@ -3289,8 +3284,7 @@ void do_linter(void) tmplint = curlint; if (func == do_cancel || func == do_enter) { - currmenu = MMOST; - titlebar(NULL); + wipe_statusbar(); break; } else if (func == do_help_void) { tmplint = NULL; @@ -3316,11 +3310,6 @@ void do_linter(void) } } - wipe_statusbar(); - -#ifdef ENABLE_MULTIBUFFER - free_lints_and_return: -#endif for (curlint = lints; curlint != NULL;) { tmplint = curlint; curlint = curlint->next; @@ -3334,6 +3323,9 @@ void do_linter(void) window_init(); refresh_needed = TRUE; } + + currmenu = MMOST; + titlebar(NULL); } #endif /* ENABLE_COLOR */