fix(inccommand): don't set an invalid 'undolevels' value (#24575)

Problem:    Cannot break undo by setting 'undolevels' to itself in
            'inccommand' preview callback.
Solution:   Don't set an invalid 'undolevels' value.

Co-authored-by: Michael Henry <drmikehenry@drmikehenry.com>
This commit is contained in:
zeertzjq
2023-08-05 22:42:34 +08:00
committed by GitHub
parent 42630923fc
commit ef44e59729
2 changed files with 36 additions and 4 deletions

View File

@@ -2357,7 +2357,7 @@ static void cmdpreview_prepare(CpInfo *cpinfo)
set_put(ptr_t, &saved_bufs, buf);
u_clearall(buf);
buf->b_p_ul = LONG_MAX; // Make sure we can undo all changes
buf->b_p_ul = INT_MAX; // Make sure we can undo all changes
}
CpWinInfo cp_wininfo;