Problem: Preferred cursor column not set in interfaces.
Solution: Set w_set_curswant when setting the cursor. (David Hotham,
closes #3060)
luaV_checksandbox(L);
#endif
w->w_cursor.col = v - 1;
+ w->w_set_curswant = TRUE;
update_screen(VALID);
}
else if (strncmp(s, "width", 5) == 0)
win->win->w_cursor.lnum = lnum;
win->win->w_cursor.col = col;
+ win->win->w_set_curswant = TRUE;
update_screen(VALID);
raise_if_error();
col = (int) SvIV(ST(2));
win->w_cursor.lnum = lnum;
win->w_cursor.col = col;
+ win->w_set_curswant = TRUE;
check_cursor(); /* put cursor on an existing line */
update_screen(NOT_VALID);
}
self->win->w_cursor.lnum = lnum;
self->win->w_cursor.col = col;
+ self->win->w_set_curswant = TRUE;
#ifdef FEAT_VIRTUALEDIT
self->win->w_cursor.coladd = 0;
#endif
col = RARRAY_PTR(pos)[1];
win->w_cursor.lnum = NUM2LONG(lnum);
win->w_cursor.col = NUM2UINT(col);
+ win->w_set_curswant = TRUE;
check_cursor(); /* put cursor on an existing line */
update_screen(NOT_VALID);
return Qnil;
/* TODO: should check column */
win->w_cursor.lnum = val1;
win->w_cursor.col = col2vim(val2);
+ win->w_set_curswant = TRUE;
flags |= FL_UPDATE_SCREEN;
break;
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
--perl
%bw!
endfunc
+
+func Test_set_cursor()
+ " Check that setting the cursor position works.
+ new
+ call setline(1, ['first line', 'second line'])
+ normal gg
+ perldo $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
bwipe!
bwipe!
endfunc
+
+func Test_set_cursor()
+ " Check that setting the cursor position works.
+ py import vim
+ new
+ call setline(1, ['first line', 'second line'])
+ normal gg
+ pydo vim.current.window.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
-" Test for python 2 commands.
+" Test for python 3 commands.
" TODO: move tests from test88.in here.
if !has('python3')
bwipe!
bwipe!
endfunc
+
+func Test_set_cursor()
+ " Check that setting the cursor position works.
+ py3 import vim
+ new
+ call setline(1, ['first line', 'second line'])
+ normal gg
+ py3do vim.current.window.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
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
tcl unset bar
endfunc
+
+func Test_set_cursor()
+ " Check that setting the cursor position works.
+ new
+ call setline(1, ['first line', 'second line'])
+ normal gg
+ tcldo $::vim::current(window) cursor 1 5
+ 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
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 212,
/**/
211,
/**/