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.master
parent
8993c36366
commit
dab70d06ed
34
src/text.c
34
src/text.c
|
@ -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 && !strcmp(curlint->filename, dontwantfile))
|
||||
curlint = curlint->next;
|
||||
if (curlint == 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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue