home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.2 / 7.2.381 < prev    next >
Encoding:
Internet Message Format  |  2010-03-01  |  6.7 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.2.381
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.2.381
  11. Problem:    No completion for :behave.
  12. Solution:   Add :behave completion.  Minor related fixes. (Dominique Pelle)
  13. Files:        src/ex_docmd.c, src/ex_getln.c, src/proto/ex_docmd.pro, src/vim.h
  14.  
  15.  
  16. *** ../vim-7.2.380/src/ex_docmd.c    2010-02-03 15:14:15.000000000 +0100
  17. --- src/ex_docmd.c    2010-03-02 15:55:05.000000000 +0100
  18. ***************
  19. *** 26,35 ****
  20.       long_u    uc_argt;    /* The argument type */
  21.       char_u    *uc_rep;    /* The command's replacement string */
  22.       long    uc_def;        /* The default value for a range/count */
  23. -     scid_T    uc_scriptID;    /* SID where the command was defined */
  24.       int        uc_compl;    /* completion type */
  25. ! # if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
  26.       char_u    *uc_compl_arg;    /* completion argument if any */
  27.   # endif
  28.   } ucmd_T;
  29.   
  30. --- 26,37 ----
  31.       long_u    uc_argt;    /* The argument type */
  32.       char_u    *uc_rep;    /* The command's replacement string */
  33.       long    uc_def;        /* The default value for a range/count */
  34.       int        uc_compl;    /* completion type */
  35. ! # ifdef FEAT_EVAL
  36. !     scid_T    uc_scriptID;    /* SID where the command was defined */
  37. ! #  ifdef FEAT_CMDL_COMPL
  38.       char_u    *uc_compl_arg;    /* completion argument if any */
  39. + #  endif
  40.   # endif
  41.   } ucmd_T;
  42.   
  43. ***************
  44. *** 3156,3172 ****
  45.           return NULL;
  46.       }
  47.       for (ea.cmdidx = (cmdidx_T)0; (int)ea.cmdidx < (int)CMD_SIZE;
  48. !                      ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1))
  49. !         if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd, (size_t)len) == 0)
  50.           break;
  51.   
  52.   #ifdef FEAT_USR_CMDS
  53.       if (cmd[0] >= 'A' && cmd[0] <= 'Z')
  54. -     {
  55.           while (ASCII_ISALNUM(*p) || *p == '*')    /* Allow * wild card */
  56.           ++p;
  57. -         len = (int)(p - cmd);
  58. -     }
  59.   #endif
  60.       }
  61.   
  62. --- 3158,3172 ----
  63.           return NULL;
  64.       }
  65.       for (ea.cmdidx = (cmdidx_T)0; (int)ea.cmdidx < (int)CMD_SIZE;
  66. !                    ea.cmdidx = (cmdidx_T)((int)ea.cmdidx + 1))
  67. !         if (STRNCMP(cmdnames[(int)ea.cmdidx].cmd_name, cmd,
  68. !                                 (size_t)len) == 0)
  69.           break;
  70.   
  71.   #ifdef FEAT_USR_CMDS
  72.       if (cmd[0] >= 'A' && cmd[0] <= 'Z')
  73.           while (ASCII_ISALNUM(*p) || *p == '*')    /* Allow * wild card */
  74.           ++p;
  75.   #endif
  76.       }
  77.   
  78. ***************
  79. *** 3809,3814 ****
  80. --- 3809,3817 ----
  81.           set_context_in_profile_cmd(xp, arg);
  82.           break;
  83.   #endif
  84. +     case CMD_behave:
  85. +         xp->xp_context = EXPAND_BEHAVE;
  86. +         break;
  87.   
  88.   #endif /* FEAT_CMDL_COMPL */
  89.   
  90. ***************
  91. *** 10847,10852 ****
  92. --- 10850,10873 ----
  93.       EMSG2(_(e_invarg2), eap->arg);
  94.   }
  95.   
  96. + #if defined(FEAT_CMDL_COMPL) || defined(PROTO)
  97. + /*
  98. +  * Function given to ExpandGeneric() to obtain the possible arguments of the
  99. +  * ":behave {mswin,xterm}" command.
  100. +  */
  101. +     char_u *
  102. + get_behave_arg(xp, idx)
  103. +     expand_T    *xp UNUSED;
  104. +     int        idx;
  105. + {
  106. +     if (idx == 0)
  107. +     return (char_u *)"mswin";
  108. +     if (idx == 1)
  109. +     return (char_u *)"xterm";
  110. +     return NULL;
  111. + }
  112. + #endif
  113.   #ifdef FEAT_AUTOCMD
  114.   static int filetype_detect = FALSE;
  115.   static int filetype_plugin = FALSE;
  116. *** ../vim-7.2.380/src/ex_getln.c    2010-02-03 15:14:15.000000000 +0100
  117. --- src/ex_getln.c    2010-03-02 15:28:13.000000000 +0100
  118. ***************
  119. *** 4492,4497 ****
  120. --- 4492,4498 ----
  121.       } tab[] =
  122.       {
  123.           {EXPAND_COMMANDS, get_command_name, FALSE},
  124. +         {EXPAND_BEHAVE, get_behave_arg, TRUE},
  125.   #ifdef FEAT_USR_CMDS
  126.           {EXPAND_USER_COMMANDS, get_user_commands, FALSE},
  127.           {EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE},
  128. *** ../vim-7.2.380/src/proto/ex_docmd.pro    2008-07-04 11:43:13.000000000 +0200
  129. --- src/proto/ex_docmd.pro    2010-03-02 15:37:37.000000000 +0100
  130. ***************
  131. *** 52,55 ****
  132. --- 52,56 ----
  133.   int put_eol __ARGS((FILE *fd));
  134.   int put_line __ARGS((FILE *fd, char *s));
  135.   void dialog_msg __ARGS((char_u *buff, char *format, char_u *fname));
  136. + char_u *get_behave_arg __ARGS((expand_T *xp, int idx));
  137.   /* vim: set ft=c : */
  138. *** ../vim-7.2.380/src/vim.h    2010-02-24 14:46:58.000000000 +0100
  139. --- src/vim.h    2010-03-02 15:30:13.000000000 +0100
  140. ***************
  141. *** 595,601 ****
  142.   
  143.   /*
  144.    * Terminal highlighting attribute bits.
  145. !  * Attibutes above HL_ALL are used for syntax highlighting.
  146.    */
  147.   #define HL_NORMAL        0x00
  148.   #define HL_INVERSE        0x01
  149. --- 595,601 ----
  150.   
  151.   /*
  152.    * Terminal highlighting attribute bits.
  153. !  * Attributes above HL_ALL are used for syntax highlighting.
  154.    */
  155.   #define HL_NORMAL        0x00
  156.   #define HL_INVERSE        0x01
  157. ***************
  158. *** 721,726 ****
  159. --- 721,727 ----
  160.   #define EXPAND_CSCOPE        33
  161.   #define EXPAND_SIGN        34
  162.   #define EXPAND_PROFILE        35
  163. + #define EXPAND_BEHAVE        36
  164.   
  165.   /* Values for exmode_active (0 is no exmode) */
  166.   #define EXMODE_NORMAL        1
  167. ***************
  168. *** 1262,1268 ****
  169.   } hlf_T;
  170.   
  171.   /* The HL_FLAGS must be in the same order as the HLF_ enums!
  172. !  * When chainging this also adjust the default for 'highlight'. */
  173.   #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
  174.             'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
  175.             'f', 'F', 'A', 'C', 'D', 'T', '>', \
  176. --- 1263,1269 ----
  177.   } hlf_T;
  178.   
  179.   /* The HL_FLAGS must be in the same order as the HLF_ enums!
  180. !  * When changing this also adjust the default for 'highlight'. */
  181.   #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
  182.             'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
  183.             'f', 'F', 'A', 'C', 'D', 'T', '>', \
  184. ***************
  185. *** 1430,1436 ****
  186.   #ifdef FEAT_MBYTE
  187.   /* We need to call mb_stricmp() even when we aren't dealing with a multi-byte
  188.    * encoding because mb_stricmp() takes care of all ascii and non-ascii
  189. !  * encodings, including characters with umluats in latin1, etc., while
  190.    * STRICMP() only handles the system locale version, which often does not
  191.    * handle non-ascii properly. */
  192.   
  193. --- 1431,1437 ----
  194.   #ifdef FEAT_MBYTE
  195.   /* We need to call mb_stricmp() even when we aren't dealing with a multi-byte
  196.    * encoding because mb_stricmp() takes care of all ascii and non-ascii
  197. !  * encodings, including characters with umlauts in latin1, etc., while
  198.    * STRICMP() only handles the system locale version, which often does not
  199.    * handle non-ascii properly. */
  200.   
  201. *** ../vim-7.2.380/src/version.c    2010-03-02 15:14:22.000000000 +0100
  202. --- src/version.c    2010-03-02 15:51:24.000000000 +0100
  203. ***************
  204. *** 683,684 ****
  205. --- 683,686 ----
  206.   {   /* Add new patch number below this line */
  207. + /**/
  208. +     381,
  209.   /**/
  210.  
  211. -- 
  212. I'd like to meet the man who invented sex and see what he's working on now.
  213.  
  214.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  215. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  216. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  217.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  218.