aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/normal_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-11-18 09:52:11 +0800
committerGitHub <noreply@github.com>2024-11-18 09:52:11 +0800
commit1763eddede82697a081d8741bd7e780c1b729de0 (patch)
tree073208c5f2bcdf3d4b9748476b606b486648ef02 /test/functional/legacy/normal_spec.lua
parent965dc81f818e50b5078d4b7efa5fbb8b771560f8 (diff)
downloadrneovim-1763eddede82697a081d8741bd7e780c1b729de0.tar.gz
rneovim-1763eddede82697a081d8741bd7e780c1b729de0.tar.bz2
rneovim-1763eddede82697a081d8741bd7e780c1b729de0.zip
vim-patch:9.1.0869: Problem: curswant not set on gm in folded line (#31247)
Problem: curswant not set on gm in folded line (citizenmatt) Solution: in a folded line, call update_curswant_force() fixes: vim/vim#11596 closes: vim/vim#11994 closes: vim/vim#15398 https://github.com/vim/vim/commit/9848face747ba91282d34a96dcb966bcb410bf2b Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'test/functional/legacy/normal_spec.lua')
-rw-r--r--test/functional/legacy/normal_spec.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/functional/legacy/normal_spec.lua b/test/functional/legacy/normal_spec.lua
index 717ebbba70..1ae22a83bd 100644
--- a/test/functional/legacy/normal_spec.lua
+++ b/test/functional/legacy/normal_spec.lua
@@ -102,4 +102,33 @@ describe('normal', function()
]],
})
end)
+
+ -- oldtest: Test_normal_gm()
+ it('gm sets curswant correctly', function()
+ screen:try_resize(75, 10)
+ exec([[
+ call setline(1, repeat([" abcd\tefgh\tij"], 10))
+ call cursor(1, 1)
+ ]])
+ feed('jVjzf')
+ -- gm
+ feed('gmk')
+ eq(18, fn.virtcol('.'))
+ -- g0
+ feed('gj0k')
+ eq(1, fn.virtcol('.'))
+ -- g^
+ feed('jg^k')
+ eq(3, fn.virtcol('.'))
+ exec('call cursor(10, 1)')
+ -- gm
+ feed('gmk')
+ eq(18, fn.virtcol('.'))
+ -- g0
+ feed('gj0k')
+ eq(1, fn.virtcol('.'))
+ -- g^
+ feed('jg^k')
+ eq(3, fn.virtcol('.'))
+ end)
end)