From ce3d9503b2f47f592be5cee51af4f78285c69506 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 14 Sep 2019 17:44:29 -0400 Subject: vim-patch:8.1.0212: preferred cursor column not set in interfaces Problem: Preferred cursor column not set in interfaces. Solution: Set w_set_curswant when setting the cursor. (David Hotham, closes vim/vim#3060) https://github.com/vim/vim/commit/53901442f37a59e5495165f91db5574c0b43ab04 This contains test_ruby changes only. test_python changes were ported before. --- src/nvim/testdir/test_ruby.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/nvim/testdir/test_ruby.vim b/src/nvim/testdir/test_ruby.vim index 01901d5db3..ef1a2d25b7 100644 --- a/src/nvim/testdir/test_ruby.vim +++ b/src/nvim/testdir/test_ruby.vim @@ -59,3 +59,16 @@ func Test_rubyfile() call assert_fails('rubyfile ' . tempfile) call delete(tempfile) endfunc + +func Test_set_cursor() + " Check that setting the cursor position works. + new + call setline(1, ['first line', 'second line']) + normal gg + rubydo $curwin.cursor = [1, 5] + call assert_equal([1, 6], [line('.'), col('.')]) + + " Check that movement after setting cursor position keeps current column. + normal j + call assert_equal([2, 6], [line('.'), col('.')]) +endfunc -- cgit