mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 05:28:33 +00:00
vim-patch:9.1.0015: i_CTRL-R- no longer works in replace mode
Problem: i_CTRL-R- no longer works in replace mode
Solution: delete characters in replace mode before putting, add a test,
add a bit warning into the documentation, that i_CTRL-R-P/O
is not supported in Replace mode for now
fixes: vim/vim#13792
closes: vim/vim#13816
5d5cbb2b9a
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -1282,9 +1282,22 @@ int insert_reg(int regname, bool literally_arg)
|
||||
} else {
|
||||
for (size_t i = 0; i < reg->y_size; i++) {
|
||||
if (regname == '-') {
|
||||
Direction dir = BACKWARD;
|
||||
if ((State & REPLACE_FLAG) != 0) {
|
||||
pos_T curpos;
|
||||
u_save_cursor();
|
||||
del_bytes((colnr_T)strlen(reg->y_array[0]), true, false);
|
||||
curpos = curwin->w_cursor;
|
||||
if (oneright() == FAIL) {
|
||||
// hit end of line, need to put forward (after the current position)
|
||||
dir = FORWARD;
|
||||
}
|
||||
curwin->w_cursor = curpos;
|
||||
}
|
||||
|
||||
AppendCharToRedobuff(Ctrl_R);
|
||||
AppendCharToRedobuff(regname);
|
||||
do_put(regname, NULL, BACKWARD, 1, PUT_CURSEND);
|
||||
do_put(regname, NULL, dir, 1, PUT_CURSEND);
|
||||
} else {
|
||||
stuffescaped(reg->y_array[i], literally);
|
||||
}
|
||||
|
Reference in New Issue
Block a user