Commit dab70d06 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

linting: when no is said to a file, remove all corresponding entries

When the user chooses not to open a file that some message refers to,
remove all messages for that file from the linting results, so the user
does not get asked about that same file again.

This fixes https://savannah.gnu.org/bugs/?47130.
No related merge requests found
Showing with 29 additions and 5 deletions
+29 -5
......@@ -3267,15 +3267,39 @@ void do_linter(void)
SET(MULTIBUFFER);
open_buffer(curlint->filename, FALSE);
} else {
char *dontwantfile = curlint->filename;
char *dontwantfile = mallocstrcpy(NULL, curlint->filename);
lintstruct *restlint = NULL;
while (curlint != NULL) {
if (strcmp(curlint->filename, dontwantfile) == 0) {
if (curlint == lints)
lints = curlint->next;
else
curlint->prev->next = curlint->next;
if (curlint->next != NULL)
curlint->next->prev = curlint->prev;
tmplint = curlint;
curlint = curlint->next;
free(tmplint->msg);
free(tmplint->filename);
free(tmplint);
} else {
if (restlint == NULL)
restlint = curlint;
curlint = curlint->next;
}
}
while (curlint != NULL && !strcmp(curlint->filename, dontwantfile))
curlint = curlint->next;
if (curlint == NULL) {
if (restlint == NULL) {
statusbar(_("No more errors in unopened files, cancelling"));
napms(2400);
break;
} else
} else {
curlint = restlint;
goto new_lint_loop;
}
free(dontwantfile);
}
} else
openfile = tmpof;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment