display: draw a new magic line rightaway when there are multiline regexes

Drawing a line will allocate multidata for it (even when the line is
actually empty), so that this multidata will not be missing later on
when the next line gets drawn in the same burst of keystrokes.

(This also removes the triggering of a full refresh when line numbers
are active: only the new magic line needs to be additionally drawn, in
order to get the line number printed.)

This fixes https://savannah.gnu.org/bugs/?65516.
The issue was reported by `correctmost`.

Problem existed since version 6.3, commit 80c2000f.
This commit is contained in:
Benno Schulenberg 2024-03-27 11:01:29 +01:00
parent 4f0683a481
commit c2322f8563
1 changed files with 6 additions and 2 deletions

View File

@ -1511,8 +1511,12 @@ void inject(char *burst, size_t count)
/* If text was added to the magic line, create a new magic line. */
if (thisline == openfile->filebot && !ISSET(NO_NEWLINES)) {
new_magicline();
if (margin > 0)
refresh_needed = TRUE;
#ifdef ENABLE_COLOR
if (margin || (openfile->syntax && openfile->syntax->nmultis))
#else
if (margin)
#endif
update_line(thisline->next, 0);
}
openfile->current_x += count;