Patch 8.0.0878
Problem:    No completion for :mapclear.
Solution:   Add completion (Nobuhiro Takasaki et al. closes #1943)
Files:      runtime/doc/eval.txt, runtime/doc/map.txt, src/ex_docmd.c,
            src/ex_getln.c, src/proto/ex_docmd.pro,
            src/testdir/test_cmdline.vim, src/vim.h


*** ../vim-8.0.0877/runtime/doc/eval.txt        2017-08-05 14:49:37.409044282 
+0200
--- runtime/doc/eval.txt        2017-08-06 15:11:31.941834720 +0200
***************
*** 4367,4372 ****
--- 4368,4374 ----
                highlight       highlight groups
                history         :history suboptions
                locale          locale names (as output of locale -a)
+               mapclear        buffer argument
                mapping         mapping name
                menu            menus
                messages        |:messages| suboptions
*** ../vim-8.0.0877/runtime/doc/map.txt 2016-10-15 15:39:34.693059595 +0200
--- runtime/doc/map.txt 2017-08-06 15:11:31.941834720 +0200
***************
*** 1278,1283 ****
--- 1279,1285 ----
        -complete=highlight     highlight groups
        -complete=history       :history suboptions
        -complete=locale        locale names (as output of locale -a)
+       -complete=mapclear      buffer argument
        -complete=mapping       mapping name
        -complete=menu          menus
        -complete=messages      |:messages| suboptions
*** ../vim-8.0.0877/src/ex_docmd.c      2017-08-03 22:44:51.042797694 +0200
--- src/ex_docmd.c      2017-08-06 15:11:31.949834662 +0200
***************
*** 4223,4228 ****
--- 4223,4241 ----
        case CMD_xunmap:
            return set_context_in_map_cmd(xp, cmd, arg, forceit,
                                                      FALSE, TRUE, ea.cmdidx);
+       case CMD_mapclear:
+       case CMD_nmapclear:
+       case CMD_vmapclear:
+       case CMD_omapclear:
+       case CMD_imapclear:
+       case CMD_cmapclear:
+       case CMD_lmapclear:
+       case CMD_smapclear:
+       case CMD_xmapclear:
+           xp->xp_context = EXPAND_MAPCLEAR;
+           xp->xp_pattern = arg;
+           break;
+ 
        case CMD_abbreviate:    case CMD_noreabbrev:
        case CMD_cabbrev:       case CMD_cnoreabbrev:
        case CMD_iabbrev:       case CMD_inoreabbrev:
***************
*** 5964,5969 ****
--- 5977,5983 ----
        && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
      {EXPAND_LOCALES, "locale"},
  #endif
+     {EXPAND_MAPCLEAR, "mapclear"},
      {EXPAND_MAPPINGS, "mapping"},
      {EXPAND_MENUS, "menu"},
      {EXPAND_MESSAGES, "messages"},
***************
*** 12083,12088 ****
--- 12097,12110 ----
  }
  #endif
  
+     char_u *
+ get_mapclear_arg(expand_T *xp UNUSED, int idx)
+ {
+     if (idx == 0)
+       return (char_u *)"<buffer>";
+     return NULL;
+ }
+ 
  #ifdef FEAT_AUTOCMD
  static int filetype_detect = FALSE;
  static int filetype_plugin = FALSE;
*** ../vim-8.0.0877/src/ex_getln.c      2017-07-16 15:23:53.638383479 +0200
--- src/ex_getln.c      2017-08-06 15:11:31.949834662 +0200
***************
*** 4879,4884 ****
--- 4879,4885 ----
        {
            {EXPAND_COMMANDS, get_command_name, FALSE, TRUE},
            {EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE},
+           {EXPAND_MAPCLEAR, get_mapclear_arg, TRUE, TRUE},
            {EXPAND_MESSAGES, get_messages_arg, TRUE, TRUE},
  #ifdef FEAT_CMDHIST
            {EXPAND_HISTORY, get_history_arg, TRUE, TRUE},
*** ../vim-8.0.0877/src/proto/ex_docmd.pro      2016-10-15 15:39:34.689059624 
+0200
--- src/proto/ex_docmd.pro      2017-08-06 15:11:31.949834662 +0200
***************
*** 62,65 ****
--- 62,66 ----
  void dialog_msg(char_u *buff, char *format, char_u *fname);
  char_u *get_behave_arg(expand_T *xp, int idx);
  char_u *get_messages_arg(expand_T *xp, int idx);
+ char_u *get_mapclear_arg(expand_T *xp, int idx);
  /* vim: set ft=c : */
*** ../vim-8.0.0877/src/testdir/test_cmdline.vim        2017-04-10 
22:45:26.140352638 +0200
--- src/testdir/test_cmdline.vim        2017-08-06 15:11:31.949834662 +0200
***************
*** 222,227 ****
--- 222,232 ----
    let l = getcompletion('not', 'messages')
    call assert_equal([], l)
  
+   let l = getcompletion('', 'mapclear')
+   call assert_true(index(l, '<buffer>') >= 0)
+   let l = getcompletion('not', 'mapclear')
+   call assert_equal([], l)
+ 
    if has('cscope')
      let l = getcompletion('', 'cscope')
      let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show']
*** ../vim-8.0.0877/src/vim.h   2017-08-02 22:07:08.450378993 +0200
--- src/vim.h   2017-08-06 15:11:31.949834662 +0200
***************
*** 808,813 ****
--- 808,814 ----
  #define EXPAND_USER_ADDR_TYPE 44
  #define EXPAND_PACKADD                45
  #define EXPAND_MESSAGES               46
+ #define EXPAND_MAPCLEAR               47
  
  /* Values for exmode_active (0 is no exmode) */
  #define EXMODE_NORMAL         1
*** ../vim-8.0.0877/src/version.c       2017-08-06 14:57:44.947764490 +0200
--- src/version.c       2017-08-06 15:12:47.033291988 +0200
***************
*** 771,772 ****
--- 771,774 ----
  {   /* Add new patch number below this line */
+ /**/
+     878,
  /**/

-- 
TIM:    Too late.
ARTHUR: What?
TIM:    There he is!
   [They all turn, and see a large white RABBIT lollop a few yards out of the
   cave.  Accompanied by terrifying chord and jarring metallic monster noise.]
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui