mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 21:01:24 +03:00
linting: don't try to put the cursor at a negative x position
Human column numbers are one-based, whereas x positions are zero-based. Converting from the one to the other involves subtracting one. But when the linter message does not provide a column number, the latter defaults to zero. Catch that case and change the number to one. This fixes https://savannah.gnu.org/bugs/?51550.
This commit is contained in:
parent
85bffcfeb9
commit
c24432edc4
@ -3183,7 +3183,8 @@ void do_linter(void)
|
||||
if ((tmplinecol = strtok(NULL, ",")) != NULL)
|
||||
tmpcolno = strtol(tmplinecol, NULL, 10);
|
||||
}
|
||||
|
||||
if (tmpcolno <= 0)
|
||||
tmpcolno = 1;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "text.c:do_lint:Successful parse! %ld:%ld:%s\n", (long)tmplineno, (long)tmpcolno, message);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user