mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +00:00
vim-patch:8.2.4563: "z=" in Visual mode may go beyond the end of the line
Problem: "z=" in Visual mode may go beyond the end of the line.
Solution: Adjust "badlen".
5c68617d39
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
@@ -483,6 +483,11 @@ void spell_suggest(int count)
|
||||
}
|
||||
badlen++;
|
||||
end_visual_mode();
|
||||
// make sure we don't include the NUL at the end of the line
|
||||
line = get_cursor_line_ptr();
|
||||
if (badlen > (int)strlen(line) - (int)curwin->w_cursor.col) {
|
||||
badlen = (int)strlen(line) - (int)curwin->w_cursor.col;
|
||||
}
|
||||
// Find the start of the badly spelled word.
|
||||
} else if (spell_move_to(curwin, FORWARD, true, true, NULL) == 0
|
||||
|| curwin->w_cursor.col > prev_cursor.col) {
|
||||
|
Reference in New Issue
Block a user