summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_lua.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_lua.vim')
-rw-r--r--src/testdir/test_lua.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_lua.vim b/src/testdir/test_lua.vim
index 2280792034..e021a2f447 100644
--- a/src/testdir/test_lua.vim
+++ b/src/testdir/test_lua.vim
@@ -555,3 +555,20 @@ func Test_luafile_error()
call delete('Xlua_file')
bwipe!
endfunc
+
+func Test_set_cursor()
+ " Check that setting the cursor position works.
+ new
+ call setline(1, ['first line', 'second line'])
+ normal gg
+ lua << EOF
+w = vim.window()
+w.line = 1
+w.col = 5
+EOF
+ call assert_equal([1, 5], [line('.'), col('.')])
+
+ " Check that movement after setting cursor position keeps current column.
+ normal j
+ call assert_equal([2, 5], [line('.'), col('.')])
+endfunc