test_utf8_comparisons \
test_viminfo \
test_vimscript \
+ test_virtualedit \
test_visual \
test_window_cmd \
test_window_id \
else if (ve_flags == VE_ALL)
{
if (oldcoladd > win->w_cursor.col)
+ {
win->w_cursor.coladd = oldcoladd - win->w_cursor.col;
+ if (win->w_cursor.col < len && win->w_cursor.coladd > 0)
+ {
+ int cs, ce;
+
+ /* check that coladd is not more than the char width */
+ getvcol(win, &win->w_cursor, &cs, NULL, &ce);
+ if (win->w_cursor.coladd > ce - cs)
+ win->w_cursor.coladd = ce - cs;
+ }
+ }
else
/* avoid weird number when there is a miscalculation or overflow */
win->w_cursor.coladd = 0;
oap->start = VIsual;
if (VIsual_mode == 'V')
+ {
oap->start.col = 0;
+# ifdef FEAT_VIRTUALEDIT
+ oap->start.coladd = 0;
+# endif
+ }
}
/*
if (!virtual_active())
curwin->w_cursor.coladd = 0;
#endif
+ check_cursor_col();
#ifdef FEAT_FOLDING
if (cap->oap->op_type == OP_NOP
&& pos != NULL
source test_timers.vim
source test_true_false.vim
source test_unlet.vim
+source test_virtualedit.vim
source test_window_cmd.vim
--- /dev/null
+" Tests for 'virtualedit'.
+
+func Test_yank_move_change()
+ split
+ call setline(1, [
+ \ "func foo() error {",
+ \ "\tif n, err := bar();",
+ \ "\terr != nil {",
+ \ "\t\treturn err",
+ \ "\t}",
+ \ "\tn = n * n",
+ \ ])
+ set virtualedit=all
+ set ts=4
+ function! MoveSelectionDown(count) abort
+ normal! m`
+ silent! exe "'<,'>move'>+".a:count
+ norm! ``
+ endfunction
+
+ xmap ]e :<C-U>call MoveSelectionDown(v:count1)<CR>
+ 2
+ normal 2gg
+ normal J
+ normal jVj
+ normal ]e
+ normal ce
+ bwipe!
+ set virtualedit=
+ set ts=8
+endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 962,
/**/
961,
/**/