mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.2.3678: illegal memory access
Problem: Illegal memory access.
Solution: Ignore changed indent when computing byte offset.
85be8563fe
This commit is contained in:
parent
6f04d3f3ef
commit
3adc3fc540
@ -3473,6 +3473,7 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
linenr_T new_lnum = new_cursor.lnum;
|
linenr_T new_lnum = new_cursor.lnum;
|
||||||
|
size_t len;
|
||||||
|
|
||||||
// Insert at least one line. When y_type is kMTCharWise, break the first
|
// Insert at least one line. When y_type is kMTCharWise, break the first
|
||||||
// line in two.
|
// line in two.
|
||||||
@ -3592,10 +3593,11 @@ error:
|
|||||||
// Put the '] mark on the first byte of the last inserted character.
|
// Put the '] mark on the first byte of the last inserted character.
|
||||||
// Correct the length for change in indent.
|
// Correct the length for change in indent.
|
||||||
curbuf->b_op_end.lnum = new_lnum;
|
curbuf->b_op_end.lnum = new_lnum;
|
||||||
col = (colnr_T)STRLEN(y_array[y_size - 1]) - lendiff;
|
len = STRLEN(y_array[y_size - 1]);
|
||||||
|
col = (colnr_T)len - lendiff;
|
||||||
if (col > 1) {
|
if (col > 1) {
|
||||||
curbuf->b_op_end.col = col - 1 - utf_head_off(y_array[y_size - 1],
|
curbuf->b_op_end.col = col - 1 - utf_head_off(y_array[y_size - 1],
|
||||||
y_array[y_size - 1] + col - 1);
|
y_array[y_size - 1] + len - 1);
|
||||||
} else {
|
} else {
|
||||||
curbuf->b_op_end.col = 0;
|
curbuf->b_op_end.col = 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user