vim-patch:9.1.1027: no sanitize check when running linematch

Problem:  no sanitize check when running linematch
Solution: add sanitize check before applying the linematch algorithm,
          similar to diff_find_change() (Jonathon)

closes: vim/vim#16446

ca307efe48

Co-authored-by: Jonathon <jonathonwhite@protonmail.com>
This commit is contained in:
zeertzjq
2025-02-03 22:26:32 +08:00
parent 4d0c6cae72
commit bd145a6c83
3 changed files with 68 additions and 10 deletions

View File

@@ -2127,7 +2127,8 @@ int diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus)
// Useful for scrollbind calculations which need to count all the filler lines
// above the screen.
if (lnum >= wp->w_topline && lnum < wp->w_botline
&& !dp->is_linematched && diff_linematch(dp)) {
&& !dp->is_linematched && diff_linematch(dp)
&& diff_check_sanity(curtab, dp)) {
run_linematch_algorithm(dp);
}