From 428ab6f24e6b5bae60a71138d571d57ac18528d5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 1 Nov 2022 06:14:20 +0800 Subject: fix(mark): do not restore view in op-pending mode (#20889) --- src/nvim/normal.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 3c49948b55..a83111136d 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -5697,6 +5697,10 @@ static void nv_gomark(cmdarg_T *cap) { int name; MarkMove flags = jop_flags & JOP_VIEW ? kMarkSetView : 0; // flags for moving to the mark + if (cap->oap->op_type != OP_NOP) { + // When there is a pending operator, do not restore the view as this is usually unexpected. + flags = 0; + } MarkMoveRes move_res = 0; // Result from moving to the mark const bool old_KeyTyped = KeyTyped; // getting file may reset it -- cgit