File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7978,6 +7978,10 @@ mode([expr]) Return a string that indicates the current mode.
79787978 s Select by character
79797979 S Select by line
79807980 CTRL-S Select blockwise
7981+ vs Visual by character using |v_CTRL-O| from
7982+ Select mode
7983+ Vs Visual by line using |v_CTRL-O| from Select mode
7984+ CTRL-Vs Visual blockwise using |v_CTRL-O| from Select mode
79817985 i Insert
79827986 ic Insert mode completion |compl-generic|
79837987 ix Insert mode |i_CTRL-X| completion
Original file line number Diff line number Diff line change @@ -882,6 +882,8 @@ EXTERN int VIsual_active INIT(= FALSE);
882882 // whether Visual mode is active
883883EXTERN int VIsual_select INIT (= FALSE);
884884 // whether Select mode is active
885+ EXTERN int restart_VIsual_select INIT (= 0 );
886+ // restart Select mode when next cmd finished
885887EXTERN int VIsual_reselect ;
886888 // whether to restart the selection after a
887889 // Select mode mapping or menu
Original file line number Diff line number Diff line change @@ -652,7 +652,11 @@ f_mode(typval_T *argvars, typval_T *rettv)
652652 if (VIsual_select )
653653 buf [0 ] = VIsual_mode + 's' - 'v' ;
654654 else
655+ {
655656 buf [0 ] = VIsual_mode ;
657+ if (restart_VIsual_select )
658+ buf [1 ] = 's' ;
659+ }
656660 }
657661 else if (State == HITRETURN || State == ASKMORE || State == SETWSIZE
658662 || State == CONFIRM )
Original file line number Diff line number Diff line change 1515#include "vim.h"
1616
1717static int VIsual_mode_orig = NUL ; // saved Visual mode
18- static int restart_VIsual_select = 0 ;
1918
2019#ifdef FEAT_EVAL
2120static void set_vcount_ca (cmdarg_T * cap , int * set_prevcount );
Original file line number Diff line number Diff line change @@ -746,6 +746,7 @@ func Test_mode()
746746 set complete = .
747747
748748 inoremap <F2> <C-R> =Save_mode()<CR>
749+ xnoremap <F2> <Cmd> call Save_mode()<CR>
749750
750751 normal ! 3 G
751752 exe " normal i\<F2>\<Esc> "
@@ -857,6 +858,14 @@ func Test_mode()
857858 call assert_equal (" \<C-S> " , mode (1 ))
858859 call feedkeys (" \<Esc> " , ' xt' )
859860
861+ " v_CTRL-O
862+ exe " normal gh\<C-O>\<F2>\<Esc> "
863+ call assert_equal (" v-vs" , g: current_modes )
864+ exe " normal gH\<C-O>\<F2>\<Esc> "
865+ call assert_equal (" V-Vs" , g: current_modes )
866+ exe " normal g\<C-H>\<C-O>\<F2>\<Esc> "
867+ call assert_equal (" \<C-V> -\<C-V> s" , g: current_modes )
868+
860869 call feedkeys (" :echo \<C-R> =Save_mode()\<C-U>\<CR> " , ' xt' )
861870 call assert_equal (' c-c' , g: current_modes )
862871 call feedkeys (" gQecho \<C-R> =Save_mode()\<CR>\<CR> vi\<CR> " , ' xt' )
@@ -867,6 +876,7 @@ func Test_mode()
867876
868877 bwipe!
869878 iunmap <F2>
879+ xunmap <F2>
870880 set complete &
871881endfunc
872882
Original file line number Diff line number Diff line change @@ -755,6 +755,8 @@ static char *(features[]) =
755755
756756static int included_patches [] =
757757{ /* Add new patch number below this line */
758+ /**/
759+ 3236 ,
758760/**/
759761 3235 ,
760762/**/
You can’t perform that action at this time.
0 commit comments