mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 18:41:48 +00:00
vim-patch:9.1.1858: v:register not reset after Visual mode command (#36215)
Problem: v:register not reset after Visual mode command.
(laktak)
Solution: Reset v:register if Visual mode was active before
do_pending_operator() (zeertzjq)
fixes: vim/vim#18579
related: vim/vim#5305
closes: vim/vim#18583
b3b47e540d
This commit is contained in:
@@ -983,6 +983,8 @@ static void normal_finish_command(NormalState *s)
|
||||
s->old_mapped_len = typebuf_maplen();
|
||||
}
|
||||
|
||||
const bool prev_VIsual_active = VIsual_active;
|
||||
|
||||
// If an operation is pending, handle it. But not for K_IGNORE or
|
||||
// K_MOUSEMOVE.
|
||||
if (s->ca.cmdchar != K_IGNORE && s->ca.cmdchar != K_MOUSEMOVE) {
|
||||
@@ -1000,7 +1002,7 @@ normal_end:
|
||||
|
||||
msg_nowait = false;
|
||||
|
||||
if (finish_op) {
|
||||
if (finish_op || prev_VIsual_active) {
|
||||
set_reg_var(get_default_register_name());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user