aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-15 23:02:48 +0800
committerGitHub <noreply@github.com>2022-11-15 23:02:48 +0800
commitc70d90dbfdf67bb009d2976a5d0760be4010e533 (patch)
treef303d4ac87a0fe278f939b17b9470bb3a21ed4ae /src/nvim/ops.c
parent211c568e6452e62b119ac4b987ff47b9174ec9ad (diff)
downloadrneovim-c70d90dbfdf67bb009d2976a5d0760be4010e533.tar.gz
rneovim-c70d90dbfdf67bb009d2976a5d0760be4010e533.tar.bz2
rneovim-c70d90dbfdf67bb009d2976a5d0760be4010e533.zip
vim-patch:9.0.0884: mouse shape remains in op-pending mode after failed change (#21066)
Problem: Mouse shape remains in op-pending mode after failed change. Solution: Reset finish_op and restore it. (closes vim/vim#11545) https://github.com/vim/vim/commit/cdeb65729d96c90320b9009e583ade305c396f29
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index f61c978f3c..f1814291b8 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -2483,8 +2483,14 @@ int op_change(oparg_T *oap)
fix_indent();
}
+ // Reset finish_op now, don't want it set inside edit().
+ const bool save_finish_op = finish_op;
+ finish_op = false;
+
retval = edit(NUL, false, (linenr_T)1);
+ finish_op = save_finish_op;
+
// In Visual block mode, handle copying the new text to all lines of the
// block.
// Don't repeat the insert when Insert mode ended with CTRL-C.
@@ -5635,8 +5641,6 @@ bool set_ref_in_opfunc(int copyID)
static void op_function(const oparg_T *oap)
FUNC_ATTR_NONNULL_ALL
{
- const TriState save_virtual_op = virtual_op;
- const bool save_finish_op = finish_op;
const pos_T orig_start = curbuf->b_op_start;
const pos_T orig_end = curbuf->b_op_end;
@@ -5663,9 +5667,11 @@ static void op_function(const oparg_T *oap)
// Reset virtual_op so that 'virtualedit' can be changed in the
// function.
+ const TriState save_virtual_op = virtual_op;
virtual_op = kNone;
// Reset finish_op so that mode() returns the right value.
+ const bool save_finish_op = finish_op;
finish_op = false;
typval_T rettv;
@@ -6205,8 +6211,6 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
// Restore linebreak, so that when the user edits it looks as before.
restore_lbr(lbr_saved);
- // Reset finish_op now, don't want it set inside edit().
- finish_op = false;
if (op_change(oap)) { // will call edit()
cap->retval |= CA_COMMAND_BUSY;
}