aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/window_spec.lua
diff options
context:
space:
mode:
authorDavid Hotham <david.hotham@metaswitch.com>2018-06-25 01:14:55 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-06-25 02:14:55 +0200
commit1cbc8301897c09d381074397b82450f81d7854be (patch)
tree0587f26749468a6872ab4724b23ba451898b0517 /test/functional/api/window_spec.lua
parente475476d1041a6632cfb9d3fff48051fcef0fbf5 (diff)
downloadrneovim-1cbc8301897c09d381074397b82450f81d7854be.tar.gz
rneovim-1cbc8301897c09d381074397b82450f81d7854be.tar.bz2
rneovim-1cbc8301897c09d381074397b82450f81d7854be.zip
API: nvim_win_set_cursor: set curswant #8613
Fixes #8591
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()