]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.514
- add patches 7.3.619-743
[packages/vim.git] / 7.3.514
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.514
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.3.514
11 Problem:    No completion for :history command.
12 Solution:   Add the completion and update the docs. Also fix ":behave"
13             completion. (Dominique Pelle)
14 Files:      runtime/doc/cmdline.txt, runtime/doc/map.txt, src/ex_docmd.c,
15             src/ex_getln.c, src/vim.h
16
17
18 *** ../vim-7.3.513/runtime/doc/cmdline.txt      2010-08-15 21:57:17.000000000 +0200
19 --- runtime/doc/cmdline.txt     2012-04-30 18:30:00.000000000 +0200
20 ***************
21 *** 330,341 ****
22   
23   :his[tory] [{name}] [{first}][, [{last}]]
24                 List the contents of history {name} which can be:
25 !               c[md]    or :   command-line history
26 !               s[earch] or /   search string history
27 !               e[xpr]   or =   expression register history
28 !               i[nput]  or @   input line history
29 !               d[ebug]  or >   debug command history
30 !               a[ll]           all of the above
31                 {not in Vi}
32   
33                 If the numbers {first} and/or {last} are given, the respective
34 --- 330,341 ----
35   
36   :his[tory] [{name}] [{first}][, [{last}]]
37                 List the contents of history {name} which can be:
38 !               c[md]    or :           command-line history
39 !               s[earch] or / or ?      search string history
40 !               e[xpr]   or =           expression register history
41 !               i[nput]  or @           input line history
42 !               d[ebug]  or >           debug command history
43 !               a[ll]                   all of the above
44                 {not in Vi}
45   
46                 If the numbers {first} and/or {last} are given, the respective
47 *** ../vim-7.3.513/runtime/doc/map.txt  2011-07-20 16:36:35.000000000 +0200
48 --- runtime/doc/map.txt 2012-04-30 18:30:00.000000000 +0200
49 ***************
50 *** 1202,1207 ****
51 --- 1219,1225 ----
52   
53         -complete=augroup       autocmd groups
54         -complete=buffer        buffer names
55 +       -complete=behave        :behave suboptions
56         -complete=color         color schemes
57         -complete=command       Ex command (and arguments)
58         -complete=compiler      compilers
59 ***************
60 *** 1216,1221 ****
61 --- 1234,1240 ----
62         -complete=function      function name
63         -complete=help          help subjects
64         -complete=highlight     highlight groups
65 +       -complete=history       :history suboptions
66         -complete=locale        locale names (as output of locale -a)
67         -complete=mapping       mapping name
68         -complete=menu          menus
69 *** ../vim-7.3.513/src/ex_docmd.c       2012-02-12 20:13:55.000000000 +0100
70 --- src/ex_docmd.c      2012-04-30 18:33:27.000000000 +0200
71 ***************
72 *** 3920,3927 ****
73 --- 3920,3935 ----
74   #endif
75         case CMD_behave:
76             xp->xp_context = EXPAND_BEHAVE;
77 +           xp->xp_pattern = arg;
78             break;
79   
80 + #if defined(FEAT_CMDHIST)
81 +       case CMD_history:
82 +           xp->xp_context = EXPAND_HISTORY;
83 +           xp->xp_pattern = arg;
84 +           break;
85 + #endif
86
87   #endif /* FEAT_CMDL_COMPL */
88   
89         default:
90 ***************
91 *** 5329,5334 ****
92 --- 5337,5343 ----
93   } command_complete[] =
94   {
95       {EXPAND_AUGROUP, "augroup"},
96 +     {EXPAND_BEHAVE, "behave"},
97       {EXPAND_BUFFERS, "buffer"},
98       {EXPAND_COLORS, "color"},
99       {EXPAND_COMMANDS, "command"},
100 ***************
101 *** 5350,5357 ****
102       {EXPAND_FUNCTIONS, "function"},
103       {EXPAND_HELP, "help"},
104       {EXPAND_HIGHLIGHT, "highlight"},
105   #if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
106 !         && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
107       {EXPAND_LOCALES, "locale"},
108   #endif
109       {EXPAND_MAPPINGS, "mapping"},
110 --- 5359,5369 ----
111       {EXPAND_FUNCTIONS, "function"},
112       {EXPAND_HELP, "help"},
113       {EXPAND_HIGHLIGHT, "highlight"},
114 + #if defined(FEAT_CMDHIST)
115 +     {EXPAND_HISTORY, "history"},
116 + #endif
117   #if (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
118 !       && (defined(FEAT_GETTEXT) || defined(FEAT_MBYTE))
119       {EXPAND_LOCALES, "locale"},
120   #endif
121       {EXPAND_MAPPINGS, "mapping"},
122 *** ../vim-7.3.513/src/ex_getln.c       2012-03-07 19:16:49.000000000 +0100
123 --- src/ex_getln.c      2012-04-30 18:36:04.000000000 +0200
124 ***************
125 *** 25,31 ****
126       int               cmdlen;         /* number of chars in command line */
127       int               cmdpos;         /* current cursor position */
128       int               cmdspos;        /* cursor column on screen */
129 !     int               cmdfirstc;      /* ':', '/', '?', '=' or NUL */
130       int               cmdindent;      /* number of spaces before cmdline */
131       char_u    *cmdprompt;     /* message in front of cmdline */
132       int               cmdattr;        /* attributes for prompt */
133 --- 25,31 ----
134       int               cmdlen;         /* number of chars in command line */
135       int               cmdpos;         /* current cursor position */
136       int               cmdspos;        /* cursor column on screen */
137 !     int               cmdfirstc;      /* ':', '/', '?', '=', '>' or NUL */
138       int               cmdindent;      /* number of spaces before cmdline */
139       char_u    *cmdprompt;     /* message in front of cmdline */
140       int               cmdattr;        /* attributes for prompt */
141 ***************
142 *** 111,116 ****
143 --- 111,119 ----
144   #ifdef FEAT_CMDL_COMPL
145   static int    expand_shellcmd __ARGS((char_u *filepat, int *num_file, char_u ***file, int flagsarg));
146   static int    ExpandRTDir __ARGS((char_u *pat, int *num_file, char_u ***file, char *dirname[]));
147 + # ifdef FEAT_CMDHIST
148 + static char_u *get_history_arg __ARGS((expand_T *xp, int idx));
149 + # endif
150   # if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL)
151   static int    ExpandUserDefined __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file));
152   static int    ExpandUserList __ARGS((expand_T *xp, int *num_file, char_u ***file));
153 ***************
154 *** 4628,4633 ****
155 --- 4631,4639 ----
156         {
157             {EXPAND_COMMANDS, get_command_name, FALSE, TRUE},
158             {EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE},
159 + #ifdef FEAT_CMDHIST
160 +           {EXPAND_HISTORY, get_history_arg, TRUE, TRUE},
161 + #endif
162   #ifdef FEAT_USR_CMDS
163             {EXPAND_USER_COMMANDS, get_user_commands, FALSE, TRUE},
164             {EXPAND_USER_CMD_FLAGS, get_user_cmd_flags, FALSE, TRUE},
165 ***************
166 *** 5245,5250 ****
167 --- 5251,5284 ----
168       NULL
169   };
170   
171 + #if defined(FEAT_CMDL_COMPL) || defined(PROTO)
172 + /*
173 +  * Function given to ExpandGeneric() to obtain the possible first
174 +  * arguments of the ":history command.
175 +  */
176 +     static char_u *
177 + get_history_arg(xp, idx)
178 +     expand_T  *xp UNUSED;
179 +     int               idx;
180 + {
181 +     static char_u compl[2] = { NUL, NUL };
182 +     char *short_names = ":=@>?/";
183 +     int short_names_count = STRLEN(short_names);
184 +     int history_name_count = sizeof(history_names) / sizeof(char *) - 1;
185
186 +     if (idx < short_names_count)
187 +     {
188 +       compl[0] = (char_u)short_names[idx];
189 +       return compl;
190 +     }
191 +     if (idx < short_names_count + history_name_count)
192 +       return (char_u *)history_names[idx - short_names_count];
193 +     if (idx == short_names_count + history_name_count)
194 +       return (char_u *)"all";
195 +     return NULL;
196 + }
197 + #endif
198
199   /*
200    * init_history() - Initialize the command line history.
201    * Also used to re-allocate the history when the size changes.
202 *** ../vim-7.3.513/src/vim.h    2012-03-23 16:25:13.000000000 +0100
203 --- src/vim.h   2012-04-30 18:30:00.000000000 +0200
204 ***************
205 *** 781,786 ****
206 --- 781,787 ----
207   #define EXPAND_FILES_IN_PATH  38
208   #define EXPAND_OWNSYNTAX      39
209   #define EXPAND_LOCALES                40
210 + #define EXPAND_HISTORY                41
211   
212   /* Values for exmode_active (0 is no exmode) */
213   #define EXMODE_NORMAL         1
214 *** ../vim-7.3.513/src/version.c        2012-04-30 18:18:43.000000000 +0200
215 --- src/version.c       2012-04-30 18:36:19.000000000 +0200
216 ***************
217 *** 716,717 ****
218 --- 716,719 ----
219   {   /* Add new patch number below this line */
220 + /**/
221 +     514,
222   /**/
223
224 -- 
225 You can be stopped by the police for biking over 65 miles per hour.
226 You are not allowed to walk across a street on your hands.
227                 [real standing laws in Connecticut, United States of America]
228
229  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
230 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
231 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
232  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.054329 seconds and 3 git commands to generate.