aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/window_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/api/window_spec.lua')
-rw-r--r--test/functional/api/window_spec.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua
index 8a65d3f71e..d404ef5426 100644
--- a/test/functional/api/window_spec.lua
+++ b/test/functional/api/window_spec.lua
@@ -108,6 +108,29 @@ describe('api/win', function()
neq(win, curwin())
end)
+ it('remembers what column it wants to be in', function()
+ insert("first line")
+ feed('o<esc>')
+ insert("second line")
+
+ feed('gg')
+ wait() -- let nvim process the 'gg' command
+
+ -- cursor position is at beginning
+ local win = curwin()
+ eq({1, 0}, window('get_cursor', win))
+
+ -- move cursor to column 5
+ window('set_cursor', win, {1, 5})
+
+ -- move down a line
+ feed('j')
+ wait() -- let nvim process the 'j' command
+
+ -- cursor is still in column 5
+ eq({2, 5}, window('get_cursor', win))
+ end)
+
end)
describe('{get,set}_height', function()