Patch 8.1.2212
Problem:    Cannot see the selection type in :reg output. (Ayberk Aydın)
Solution:   Add c/l/b. (Christian Brabandt, closes #5110, closes #4546)
Files:      runtime/doc/change.txt, src/register.c,
            src/testdir/test_registers.vim


*** ../vim-8.1.2211/runtime/doc/change.txt      2019-09-28 19:04:06.997029566 
+0200
--- runtime/doc/change.txt      2019-10-24 20:11:43.182169894 +0200
***************
*** 1003,1011 ****
                        delete and yank) ({.%#:} only work with put).
  
                                                        *:reg* *:registers*
! :reg[isters]          Display the contents of all numbered and named
!                       registers.  If a register is written to for |:redir|
!                       it will not be listed.
  
  
  :reg[isters] {arg}    Display the contents of the numbered and named
--- 999,1011 ----
                        delete and yank) ({.%#:} only work with put).
  
                                                        *:reg* *:registers*
! :reg[isters]          Display the type and contents of all numbered and
!                       named registers.  If a register is written to for
!                       |:redir| it will not be listed.
!                       Type can be one of:
!                       "c"     for |characterwise| text
!                       "l"     for |linewise| text
!                       "b"     for |blockwise-visual| text
  
  
  :reg[isters] {arg}    Display the contents of the numbered and named
*** ../vim-8.1.2211/src/register.c      2019-10-17 22:58:59.070496999 +0200
--- src/register.c      2019-10-24 20:15:44.685352674 +0200
***************
*** 2161,2176 ****
      int               attr;
      char_u    *arg = eap->arg;
      int               clen;
  
      if (arg != NULL && *arg == NUL)
        arg = NULL;
      attr = HL_ATTR(HLF_8);
  
      // Highlight title
!     msg_puts_title(_("\n--- Registers ---"));
      for (i = -1; i < NUM_REGISTERS && !got_int; ++i)
      {
        name = get_register_name(i);
        if (arg != NULL && vim_strchr(arg, name) == NULL
  #ifdef ONE_CLIPBOARD
            // Star register and plus register contain the same thing.
--- 2161,2183 ----
      int               attr;
      char_u    *arg = eap->arg;
      int               clen;
+     char_u      type[2];
  
      if (arg != NULL && *arg == NUL)
        arg = NULL;
      attr = HL_ATTR(HLF_8);
  
      // Highlight title
!     msg_puts_title(_("\nType Name Content"));
      for (i = -1; i < NUM_REGISTERS && !got_int; ++i)
      {
        name = get_register_name(i);
+       switch (get_reg_type(name, NULL))
+       {
+           case MLINE: type[0] = 'l'; break;
+           case MCHAR: type[0] = 'c'; break;
+           default:    type[0] = 'b'; break;
+       }
        if (arg != NULL && vim_strchr(arg, name) == NULL
  #ifdef ONE_CLIPBOARD
            // Star register and plus register contain the same thing.
***************
*** 2207,2217 ****
        if (yb->y_array != NULL)
        {
            msg_putchar('\n');
            msg_putchar('"');
            msg_putchar(name);
            msg_puts("   ");
  
!           n = (int)Columns - 6;
            for (j = 0; j < yb->y_size && n > 1; ++j)
            {
                if (j)
--- 2214,2227 ----
        if (yb->y_array != NULL)
        {
            msg_putchar('\n');
+           msg_puts("  ");
+           msg_putchar(type[0]);
+           msg_puts("  ");
            msg_putchar('"');
            msg_putchar(name);
            msg_puts("   ");
  
!           n = (int)Columns - 11;
            for (j = 0; j < yb->y_size && n > 1; ++j)
            {
                if (j)
***************
*** 2237,2243 ****
      if ((p = get_last_insert()) != NULL
                 && (arg == NULL || vim_strchr(arg, '.') != NULL) && !got_int)
      {
!       msg_puts("\n\".   ");
        dis_msg(p, TRUE);
      }
  
--- 2247,2253 ----
      if ((p = get_last_insert()) != NULL
                 && (arg == NULL || vim_strchr(arg, '.') != NULL) && !got_int)
      {
!       msg_puts("\n  c  \".   ");
        dis_msg(p, TRUE);
      }
  
***************
*** 2245,2251 ****
      if (last_cmdline != NULL && (arg == NULL || vim_strchr(arg, ':') != NULL)
                                                                  && !got_int)
      {
!       msg_puts("\n\":   ");
        dis_msg(last_cmdline, FALSE);
      }
  
--- 2255,2261 ----
      if (last_cmdline != NULL && (arg == NULL || vim_strchr(arg, ':') != NULL)
                                                                  && !got_int)
      {
!       msg_puts("\n  c  \":   ");
        dis_msg(last_cmdline, FALSE);
      }
  
***************
*** 2253,2259 ****
      if (curbuf->b_fname != NULL
            && (arg == NULL || vim_strchr(arg, '%') != NULL) && !got_int)
      {
!       msg_puts("\n\"%   ");
        dis_msg(curbuf->b_fname, FALSE);
      }
  
--- 2263,2269 ----
      if (curbuf->b_fname != NULL
            && (arg == NULL || vim_strchr(arg, '%') != NULL) && !got_int)
      {
!       msg_puts("\n  c  \"%   ");
        dis_msg(curbuf->b_fname, FALSE);
      }
  
***************
*** 2265,2271 ****
  
        if (buflist_name_nr(0, &fname, &dummy) != FAIL)
        {
!           msg_puts("\n\"#   ");
            dis_msg(fname, FALSE);
        }
      }
--- 2275,2281 ----
  
        if (buflist_name_nr(0, &fname, &dummy) != FAIL)
        {
!           msg_puts("\n  c  \"#   ");
            dis_msg(fname, FALSE);
        }
      }
***************
*** 2274,2280 ****
      if (last_search_pat() != NULL
                 && (arg == NULL || vim_strchr(arg, '/') != NULL) && !got_int)
      {
!       msg_puts("\n\"/   ");
        dis_msg(last_search_pat(), FALSE);
      }
  
--- 2284,2290 ----
      if (last_search_pat() != NULL
                 && (arg == NULL || vim_strchr(arg, '/') != NULL) && !got_int)
      {
!       msg_puts("\n  c  \"/   ");
        dis_msg(last_search_pat(), FALSE);
      }
  
***************
*** 2283,2289 ****
      if (expr_line != NULL && (arg == NULL || vim_strchr(arg, '=') != NULL)
                                                                  && !got_int)
      {
!       msg_puts("\n\"=   ");
        dis_msg(expr_line, FALSE);
      }
  #endif
--- 2293,2299 ----
      if (expr_line != NULL && (arg == NULL || vim_strchr(arg, '=') != NULL)
                                                                  && !got_int)
      {
!       msg_puts("\n  c  \"=   ");
        dis_msg(expr_line, FALSE);
      }
  #endif
***************
*** 2515,2521 ****
  #endif
  
  
- #if defined(FEAT_EVAL) || defined(PROTO)
  /*
   * Return the type of a register.
   * Used for getregtype()
--- 2525,2530 ----
***************
*** 2560,2565 ****
--- 2569,2575 ----
      return MAUTO;
  }
  
+ #if defined(FEAT_EVAL) || defined(PROTO)
  /*
   * When "flags" has GREG_LIST return a list with text "s".
   * Otherwise just return "s".
*** ../vim-8.1.2211/src/testdir/test_registers.vim      2019-05-25 
21:52:25.096355509 +0200
--- src/testdir/test_registers.vim      2019-10-24 20:11:43.182169894 +0200
***************
*** 39,64 ****
      let b = execute('registers')
  
      call assert_equal(a, b)
!     call assert_match('^\n--- Registers ---\n'
!           \ .         '""   a\n'
!           \ .         '"0   ba\n'
!           \ .         '"a   b\n'
            \ .         '.*'
!           \ .         '"-   a\n'
            \ .         '.*'
!           \ .         '":   ls\n'
!           \ .         '"%   file2\n'
!           \ .         '"#   file1\n'
!           \ .         '"/   bar\n'
!           \ .         '"=   2\*4', a)
  
      let a = execute('registers a')
!     call assert_match('^\n--- Registers ---\n'
!           \ .         '"a   b', a)
  
      let a = execute('registers :')
!     call assert_match('^\n--- Registers ---\n'
!           \ .         '":   ls', a)
  
      bwipe!
  endfunc
--- 39,64 ----
      let b = execute('registers')
  
      call assert_equal(a, b)
!     call assert_match('^\nType Name Content\n'
!           \ .         '  c  ""   a\n'
!           \ .         '  c  "0   ba\n'
!           \ .         '  c  "a   b\n'
            \ .         '.*'
!           \ .         '  c  "-   a\n'
            \ .         '.*'
!           \ .         '  c  ":   ls\n'
!           \ .         '  c  "%   file2\n'
!           \ .         '  c  "#   file1\n'
!           \ .         '  c  "/   bar\n'
!           \ .         '  c  "=   2\*4', a)
  
      let a = execute('registers a')
!     call assert_match('^\nType Name Content\n'
!           \ .         '  c  "a   b', a)
  
      let a = execute('registers :')
!     call assert_match('^\nType Name Content\n'
!           \ .         '  c  ":   ls', a)
  
      bwipe!
  endfunc
*** ../vim-8.1.2211/src/version.c       2019-10-24 20:07:04.419105304 +0200
--- src/version.c       2019-10-24 20:13:49.081744460 +0200
***************
*** 743,744 ****
--- 743,746 ----
  {   /* Add new patch number below this line */
+ /**/
+     2212,
  /**/

-- 
Lower life forms have more fun!

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/201910241817.x9OIHwDC024134%40masaka.moolenaar.net.

Raspunde prin e-mail lui