mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 06:58:35 +00:00
fix(mark): do not restore view in op-pending mode (#20889)
This commit is contained in:
@@ -5697,6 +5697,10 @@ static void nv_gomark(cmdarg_T *cap)
|
|||||||
{
|
{
|
||||||
int name;
|
int name;
|
||||||
MarkMove flags = jop_flags & JOP_VIEW ? kMarkSetView : 0; // flags for moving to the mark
|
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
|
MarkMoveRes move_res = 0; // Result from moving to the mark
|
||||||
const bool old_KeyTyped = KeyTyped; // getting file may reset it
|
const bool old_KeyTyped = KeyTyped; // getting file may reset it
|
||||||
|
|
||||||
|
@@ -330,7 +330,7 @@ describe('named marks view', function()
|
|||||||
os.remove(file2)
|
os.remove(file2)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('is restored', function()
|
it('is restored in normal mode but not op-pending mode', function()
|
||||||
local screen = Screen.new(5, 8)
|
local screen = Screen.new(5, 8)
|
||||||
screen:attach()
|
screen:attach()
|
||||||
command("edit " .. file1)
|
command("edit " .. file1)
|
||||||
@@ -358,6 +358,18 @@ describe('named marks view', function()
|
|||||||
8 line |
|
8 line |
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
|
-- not in op-pending mode #20886
|
||||||
|
feed("ggj=`a")
|
||||||
|
screen:expect([[
|
||||||
|
1 line |
|
||||||
|
^2 line |
|
||||||
|
3 line |
|
||||||
|
4 line |
|
||||||
|
5 line |
|
||||||
|
6 line |
|
||||||
|
7 line |
|
||||||
|
|
|
||||||
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('is restored across files', function()
|
it('is restored across files', function()
|
||||||
|
Reference in New Issue
Block a user