mirror of
https://github.com/neovim/neovim.git
synced 2025-09-23 19:48:32 +00:00
vim-patch:9.1.1143: illegal memory access when putting a register (#32604)
Problem: illegal memory access when putting a register
Solution: make sure cursor column doesn't become negative
e0029daa35
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -3623,7 +3623,7 @@ error:
|
||||
// Put the '] mark on the first byte of the last inserted character.
|
||||
// Correct the length for change in indent.
|
||||
curbuf->b_op_end.lnum = new_lnum;
|
||||
col = (colnr_T)y_array[y_size - 1].size - lendiff;
|
||||
col = MAX(0, (colnr_T)y_array[y_size - 1].size - lendiff);
|
||||
if (col > 1) {
|
||||
curbuf->b_op_end.col = col - 1;
|
||||
if (y_array[y_size - 1].size > 0) {
|
||||
|
Reference in New Issue
Block a user