Patch 8.2.3236
Problem:    mode() does not indicate using CTRL-O in Select mode.
Solution:   Use "vs" and similar. (closes #8640)
Files:      runtime/doc/eval.txt, src/globals.h, src/misc1.c, src/normal.c,
            src/testdir/test_functions.vim


*** ../vim-8.2.3235/runtime/doc/eval.txt        2021-07-26 21:54:00.051491580 
+0200
--- runtime/doc/eval.txt        2021-07-28 16:34:52.607468476 +0200
***************
*** 7939,7944 ****
--- 7993,8002 ----
                   s        Select by character
                   S        Select by line
                   CTRL-S   Select blockwise
+                  vs       Visual by character using |v_CTRL-O| from
+                               Select mode
+                  Vs       Visual by line using |v_CTRL-O| from Select mode
+                  CTRL-Vs  Visual blockwise using |v_CTRL-O| from Select mode
                   i        Insert
                   ic       Insert mode completion |compl-generic|
                   ix       Insert mode |i_CTRL-X| completion
*** ../vim-8.2.3235/src/globals.h       2021-07-25 14:21:08.111502006 +0200
--- src/globals.h       2021-07-28 16:34:52.607468476 +0200
***************
*** 882,887 ****
--- 882,889 ----
                                // whether Visual mode is active
  EXTERN int    VIsual_select INIT(= FALSE);
                                // whether Select mode is active
+ EXTERN int    restart_VIsual_select INIT(= 0);
+                               // restart Select mode when next cmd finished
  EXTERN int    VIsual_reselect;
                                // whether to restart the selection after a
                                // Select mode mapping or menu
*** ../vim-8.2.3235/src/misc1.c 2021-07-28 11:51:44.317061732 +0200
--- src/misc1.c 2021-07-28 16:34:52.607468476 +0200
***************
*** 652,658 ****
--- 652,662 ----
        if (VIsual_select)
            buf[0] = VIsual_mode + 's' - 'v';
        else
+       {
            buf[0] = VIsual_mode;
+           if (restart_VIsual_select)
+               buf[1] = 's';
+       }
      }
      else if (State == HITRETURN || State == ASKMORE || State == SETWSIZE
                || State == CONFIRM)
*** ../vim-8.2.3235/src/normal.c        2021-07-26 22:19:05.376122583 +0200
--- src/normal.c        2021-07-28 16:34:52.607468476 +0200
***************
*** 15,21 ****
  #include "vim.h"
  
  static int    VIsual_mode_orig = NUL;         // saved Visual mode
- static int    restart_VIsual_select = 0;
  
  #ifdef FEAT_EVAL
  static void   set_vcount_ca(cmdarg_T *cap, int *set_prevcount);
--- 15,20 ----
*** ../vim-8.2.3235/src/testdir/test_functions.vim      2021-07-27 
22:00:39.753712380 +0200
--- src/testdir/test_functions.vim      2021-07-28 16:34:52.607468476 +0200
***************
*** 746,751 ****
--- 746,752 ----
    set complete=.
  
    inoremap <F2> <C-R>=Save_mode()<CR>
+   xnoremap <F2> <Cmd>call Save_mode()<CR>
  
    normal! 3G
    exe "normal i\<F2>\<Esc>"
***************
*** 857,862 ****
--- 858,871 ----
    call assert_equal("\<C-S>", mode(1))
    call feedkeys("\<Esc>", 'xt')
  
+   " v_CTRL-O
+   exe "normal gh\<C-O>\<F2>\<Esc>"
+   call assert_equal("v-vs", g:current_modes)
+   exe "normal gH\<C-O>\<F2>\<Esc>"
+   call assert_equal("V-Vs", g:current_modes)
+   exe "normal g\<C-H>\<C-O>\<F2>\<Esc>"
+   call assert_equal("\<C-V>-\<C-V>s", g:current_modes)
+ 
    call feedkeys(":echo \<C-R>=Save_mode()\<C-U>\<CR>", 'xt')
    call assert_equal('c-c', g:current_modes)
    call feedkeys("gQecho \<C-R>=Save_mode()\<CR>\<CR>vi\<CR>", 'xt')
***************
*** 867,872 ****
--- 876,882 ----
  
    bwipe!
    iunmap <F2>
+   xunmap <F2>
    set complete&
  endfunc
  
*** ../vim-8.2.3235/src/version.c       2021-07-28 15:54:51.168064387 +0200
--- src/version.c       2021-07-28 16:36:51.147239336 +0200
***************
*** 757,758 ****
--- 757,760 ----
  {   /* Add new patch number below this line */
+ /**/
+     3236,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
267. You get an extra phone line so you can get phone calls.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202107281452.16SEqMj91885964%40masaka.moolenaar.net.

Raspunde prin e-mail lui