API: nvim_win_set_cursor: set curswant #8613

Fixes #8591
This commit is contained in:
David Hotham
2018-06-25 01:14:55 +01:00
committed by Justin M. Keyes
parent e475476d10
commit 1cbc830189
2 changed files with 26 additions and 0 deletions

View File

@@ -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()