components/vim/vim72-patches/7.2.381
changeset 379 c6a17bba1da3
parent 378 f0b61ed1d10d
child 380 e92b3b4a1c66
equal deleted inserted replaced
378:f0b61ed1d10d 379:c6a17bba1da3
     1 To: [email protected]
       
     2 Subject: Patch 7.2.381
       
     3 Fcc: outbox
       
     4 From: Bram Moolenaar <[email protected]>
       
     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 + 
       
   114   #ifdef FEAT_AUTOCMD
       
   115   static int filetype_detect = FALSE;
       
   116   static int filetype_plugin = FALSE;
       
   117 *** ../vim-7.2.380/src/ex_getln.c	2010-02-03 15:14:15.000000000 +0100
       
   118 --- src/ex_getln.c	2010-03-02 15:28:13.000000000 +0100
       
   119 ***************
       
   120 *** 4492,4497 ****
       
   121 --- 4492,4498 ----
       
   122   	} tab[] =
       
   123   	{
       
   124   	    {EXPAND_COMMANDS, get_command_name, FALSE},
       
   125 + 	    {EXPAND_BEHAVE, get_behave_arg, TRUE},
       
   126   #ifdef FEAT_USR_CMDS
       
   127   	    {EXPAND_USER_COMMANDS, get_user_commands, FALSE},
       
   128   	    {EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE},
       
   129 *** ../vim-7.2.380/src/proto/ex_docmd.pro	2008-07-04 11:43:13.000000000 +0200
       
   130 --- src/proto/ex_docmd.pro	2010-03-02 15:37:37.000000000 +0100
       
   131 ***************
       
   132 *** 52,55 ****
       
   133 --- 52,56 ----
       
   134   int put_eol __ARGS((FILE *fd));
       
   135   int put_line __ARGS((FILE *fd, char *s));
       
   136   void dialog_msg __ARGS((char_u *buff, char *format, char_u *fname));
       
   137 + char_u *get_behave_arg __ARGS((expand_T *xp, int idx));
       
   138   /* vim: set ft=c : */
       
   139 *** ../vim-7.2.380/src/vim.h	2010-02-24 14:46:58.000000000 +0100
       
   140 --- src/vim.h	2010-03-02 15:30:13.000000000 +0100
       
   141 ***************
       
   142 *** 595,601 ****
       
   143   
       
   144   /*
       
   145    * Terminal highlighting attribute bits.
       
   146 !  * Attibutes above HL_ALL are used for syntax highlighting.
       
   147    */
       
   148   #define HL_NORMAL		0x00
       
   149   #define HL_INVERSE		0x01
       
   150 --- 595,601 ----
       
   151   
       
   152   /*
       
   153    * Terminal highlighting attribute bits.
       
   154 !  * Attributes above HL_ALL are used for syntax highlighting.
       
   155    */
       
   156   #define HL_NORMAL		0x00
       
   157   #define HL_INVERSE		0x01
       
   158 ***************
       
   159 *** 721,726 ****
       
   160 --- 721,727 ----
       
   161   #define EXPAND_CSCOPE		33
       
   162   #define EXPAND_SIGN		34
       
   163   #define EXPAND_PROFILE		35
       
   164 + #define EXPAND_BEHAVE		36
       
   165   
       
   166   /* Values for exmode_active (0 is no exmode) */
       
   167   #define EXMODE_NORMAL		1
       
   168 ***************
       
   169 *** 1262,1268 ****
       
   170   } hlf_T;
       
   171   
       
   172   /* The HL_FLAGS must be in the same order as the HLF_ enums!
       
   173 !  * When chainging this also adjust the default for 'highlight'. */
       
   174   #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
       
   175   		  'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
       
   176   		  'f', 'F', 'A', 'C', 'D', 'T', '>', \
       
   177 --- 1263,1269 ----
       
   178   } hlf_T;
       
   179   
       
   180   /* The HL_FLAGS must be in the same order as the HLF_ enums!
       
   181 !  * When changing this also adjust the default for 'highlight'. */
       
   182   #define HL_FLAGS {'8', '@', 'd', 'e', 'h', 'i', 'l', 'm', 'M', \
       
   183   		  'n', 'r', 's', 'S', 'c', 't', 'v', 'V', 'w', 'W', \
       
   184   		  'f', 'F', 'A', 'C', 'D', 'T', '>', \
       
   185 ***************
       
   186 *** 1430,1436 ****
       
   187   #ifdef FEAT_MBYTE
       
   188   /* We need to call mb_stricmp() even when we aren't dealing with a multi-byte
       
   189    * encoding because mb_stricmp() takes care of all ascii and non-ascii
       
   190 !  * encodings, including characters with umluats in latin1, etc., while
       
   191    * STRICMP() only handles the system locale version, which often does not
       
   192    * handle non-ascii properly. */
       
   193   
       
   194 --- 1431,1437 ----
       
   195   #ifdef FEAT_MBYTE
       
   196   /* We need to call mb_stricmp() even when we aren't dealing with a multi-byte
       
   197    * encoding because mb_stricmp() takes care of all ascii and non-ascii
       
   198 !  * encodings, including characters with umlauts in latin1, etc., while
       
   199    * STRICMP() only handles the system locale version, which often does not
       
   200    * handle non-ascii properly. */
       
   201   
       
   202 *** ../vim-7.2.380/src/version.c	2010-03-02 15:14:22.000000000 +0100
       
   203 --- src/version.c	2010-03-02 15:51:24.000000000 +0100
       
   204 ***************
       
   205 *** 683,684 ****
       
   206 --- 683,686 ----
       
   207   {   /* Add new patch number below this line */
       
   208 + /**/
       
   209 +     381,
       
   210   /**/
       
   211 
       
   212 -- 
       
   213 I'd like to meet the man who invented sex and see what he's working on now.
       
   214 
       
   215  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
       
   216 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
       
   217 \\\        download, build and distribute -- http://www.A-A-P.org        ///
       
   218  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///