static int resel_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */
static linenr_T resel_VIsual_line_count; /* number of lines */
static colnr_T resel_VIsual_vcol; /* nr of cols or end col */
+static int VIsual_mode_orig = NUL; /* type of Visual mode, that user entered */
static int restart_VIsual_select = 0;
#endif
curbuf->b_visual.vi_start = VIsual;
curbuf->b_visual.vi_end = curwin->w_cursor;
curbuf->b_visual.vi_mode = VIsual_mode;
+ if (VIsual_mode_orig != NUL)
+ {
+ curbuf->b_visual.vi_mode = VIsual_mode_orig;
+ VIsual_mode_orig = NUL;
+ }
curbuf->b_visual.vi_curswant = curwin->w_curswant;
# ifdef FEAT_EVAL
curbuf->b_visual_mode_eval = VIsual_mode;
{
cap->cmdchar = 'c';
cap->nchar = NUL;
+ VIsual_mode_orig = VIsual_mode; /* remember original area for gv */
VIsual_mode = 'V';
nv_operator(cap);
}
if (isupper(cap->cmdchar))
{
if (VIsual_mode != Ctrl_V)
+ {
+ VIsual_mode_orig = VIsual_mode;
VIsual_mode = 'V';
+ }
else if (cap->cmdchar == 'C' || cap->cmdchar == 'D')
curwin->w_curswant = MAXCOL;
}
if (VIsual_active) /* "vs" and "vS" are the same as "vc" */
{
if (cap->cmdchar == 'S')
+ {
+ VIsual_mode_orig = VIsual_mode;
VIsual_mode = 'V';
+ }
cap->cmdchar = 'c';
nv_operator(cap);
}
STARTTEST
:so small.vim
+/^one
+fe\164jR\eugvr1:'<,'>w! test.out
/^abcdefgh
\164jI \ej<<11|D
7|a \e
7|a \e
7|a \e4k13|\164j<
-:$-4,$w! test.out
+:$-5,$w >> test.out
:$-4,$s/\s\+//g
\164kI \ej<<
7|a \e
:qa!
ENDTEST
+one two three
+one two three
+one two three
+one two three
+one two three
+
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyz