0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

updated for version 7.0193

This commit is contained in:
Bram Moolenaar
2006-02-04 22:43:20 +00:00
parent 41cabdadc2
commit a65576059f
12 changed files with 895 additions and 303 deletions

View File

@@ -620,11 +620,12 @@ MenuPopup Just before showing the popup menu (under the
c Commmand line c Commmand line
*QuickFixCmdPre* *QuickFixCmdPre*
QuickFixCmdPre Before a quickfix command is run (|:make|, QuickFixCmdPre Before a quickfix command is run (|:make|,
|:grep|, |:grepadd|, |:vimgrep|, |:lmake|, |:grep|, |:lgrep|, |:grepadd|,
|:vimgrepadd|). The pattern is matched against |:lgrepadd|, |:vimgrep|, |:lvimgrep|,
the command being run. When |:grep| is used |:vimgrepadd|, |:vimgrepadd|). The pattern is
but 'grepprg' is set to "internal" it still matched against the command being run. When
matches "grep". |:grep| is used but 'grepprg' is set to
"internal" it still matches "grep".
This command cannot be used to set the This command cannot be used to set the
'makeprg' and 'grepprg' variables. 'makeprg' and 'grepprg' variables.
If this command causes an error, the quickfix If this command causes an error, the quickfix

View File

@@ -2943,7 +2943,8 @@ A jump table for the options with a short description can be found at |Q_op|.
also work well with a single file: > also work well with a single file: >
:set grepprg=grep\ -nH :set grepprg=grep\ -nH
< Special value: When 'grepprg' is set to "internal" the |:grep| command < Special value: When 'grepprg' is set to "internal" the |:grep| command
works like |:vimgrep| and |:grepadd| like |:vimgrepadd|. works like |:vimgrep|, |:lgrep| like |:lvimgrep|, |:grepadd| like
|:vimgrepadd| and |:lgrepadd| like |:lvimgrepadd|.
See also the section |:make_makeprg|, since most of the comments there See also the section |:make_makeprg|, since most of the comments there
apply equally to 'grepprg'. apply equally to 'grepprg'.
For Win32, the default is "findstr /n" if "findstr.exe" can be found, For Win32, the default is "findstr /n" if "findstr.exe" can be found,

View File

@@ -1788,6 +1788,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:cabc map.txt /*:cabc* :cabc map.txt /*:cabc*
:cabclear map.txt /*:cabclear* :cabclear map.txt /*:cabclear*
:cad quickfix.txt /*:cad* :cad quickfix.txt /*:cad*
:caddb quickfix.txt /*:caddb*
:caddbuffer quickfix.txt /*:caddbuffer*
:caddexpr quickfix.txt /*:caddexpr* :caddexpr quickfix.txt /*:caddexpr*
:caddf quickfix.txt /*:caddf* :caddf quickfix.txt /*:caddf*
:caddfile quickfix.txt /*:caddfile* :caddfile quickfix.txt /*:caddfile*
@@ -2105,6 +2107,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:lNfile quickfix.txt /*:lNfile* :lNfile quickfix.txt /*:lNfile*
:la editing.txt /*:la* :la editing.txt /*:la*
:lad quickfix.txt /*:lad* :lad quickfix.txt /*:lad*
:laddb quickfix.txt /*:laddb*
:laddbuffer quickfix.txt /*:laddbuffer*
:laddexpr quickfix.txt /*:laddexpr* :laddexpr quickfix.txt /*:laddexpr*
:laddf quickfix.txt /*:laddf* :laddf quickfix.txt /*:laddf*
:laddfile quickfix.txt /*:laddfile* :laddfile quickfix.txt /*:laddfile*
@@ -2143,6 +2147,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:lfirst quickfix.txt /*:lfirst* :lfirst quickfix.txt /*:lfirst*
:lg quickfix.txt /*:lg* :lg quickfix.txt /*:lg*
:lgetfile quickfix.txt /*:lgetfile* :lgetfile quickfix.txt /*:lgetfile*
:lgr quickfix.txt /*:lgr*
:lgrep quickfix.txt /*:lgrep*
:lgrepa quickfix.txt /*:lgrepa*
:lgrepadd quickfix.txt /*:lgrepadd*
:list various.txt /*:list* :list various.txt /*:list*
:ll quickfix.txt /*:ll* :ll quickfix.txt /*:ll*
:lla quickfix.txt /*:lla* :lla quickfix.txt /*:lla*
@@ -2150,6 +2158,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:lli quickfix.txt /*:lli* :lli quickfix.txt /*:lli*
:llist quickfix.txt /*:llist* :llist quickfix.txt /*:llist*
:lm map.txt /*:lm* :lm map.txt /*:lm*
:lmak quickfix.txt /*:lmak*
:lmake quickfix.txt /*:lmake*
:lmap map.txt /*:lmap* :lmap map.txt /*:lmap*
:lmap_l map.txt /*:lmap_l* :lmap_l map.txt /*:lmap_l*
:lmapc map.txt /*:lmapc* :lmapc map.txt /*:lmapc*
@@ -2185,6 +2195,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:ltag tagsrch.txt /*:ltag* :ltag tagsrch.txt /*:ltag*
:lu map.txt /*:lu* :lu map.txt /*:lu*
:lunmap map.txt /*:lunmap* :lunmap map.txt /*:lunmap*
:lv quickfix.txt /*:lv*
:lvimgrep quickfix.txt /*:lvimgrep*
:lvimgrepa quickfix.txt /*:lvimgrepa*
:lvimgrepadd quickfix.txt /*:lvimgrepadd*
:lw quickfix.txt /*:lw* :lw quickfix.txt /*:lw*
:lwindow quickfix.txt /*:lwindow* :lwindow quickfix.txt /*:lwindow*
:m change.txt /*:m* :m change.txt /*:m*
@@ -5406,6 +5420,7 @@ hebrew hebrew.txt /*hebrew*
hebrew.txt hebrew.txt /*hebrew.txt* hebrew.txt hebrew.txt /*hebrew.txt*
help various.txt /*help* help various.txt /*help*
help-context help.txt /*help-context* help-context help.txt /*help-context*
help-tags tags 1
help-translated various.txt /*help-translated* help-translated various.txt /*help-translated*
help-xterm-window various.txt /*help-xterm-window* help-xterm-window various.txt /*help-xterm-window*
help.txt help.txt /*help.txt* help.txt help.txt /*help.txt*

View File

@@ -2,7 +2,7 @@
" "
" Menu Translations: Japanese (EUC-JP) " Menu Translations: Japanese (EUC-JP)
" Translated By: MURAOKA Taro <koron@tka.att.ne.jp> " Translated By: MURAOKA Taro <koron@tka.att.ne.jp>
" Last Change: 29-Apr-2004. " Last Change: 04-Feb-2006.
" Quit when menu translations have already been done. " Quit when menu translations have already been done.
if exists("did_menu_trans") if exists("did_menu_trans")
@@ -142,7 +142,23 @@ menutrans &Open<Tab>:copen
menutrans &Close<Tab>:cclose <09>Ĥ<EFBFBD><EFBFBD><EFBFBD>(&C)<Tab>:cclose menutrans &Close<Tab>:cclose <09>Ĥ<EFBFBD><EFBFBD><EFBFBD>(&C)<Tab>:cclose
menutrans &Convert\ to\ HEX<Tab>:%!xxd HEX<EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>(&C)<Tab>:%!xxd menutrans &Convert\ to\ HEX<Tab>:%!xxd HEX<EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>(&C)<Tab>:%!xxd
menutrans Conve&rt\ back<Tab>:%!xxd\ -r HEX<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>(&R)<Tab>%!xxd\ -r menutrans Conve&rt\ back<Tab>:%!xxd\ -r HEX<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>(&R)<Tab>%!xxd\ -r
menutrans &Set\ Compiler <09><><EFBFBD><EFBFBD><EFBFBD>ѥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&S) menutrans Se&T\ Compiler <09><><EFBFBD><EFBFBD><EFBFBD>ѥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&T)
" Tools.Spelling Menu
menutrans &Spelling <09><><EFBFBD>ڥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&S)
menutrans &Spell\ Check\ On <09><><EFBFBD>ڥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD>ͭ<EFBFBD><EFBFBD>(&S)
menutrans Spell\ Check\ &Off <09><><EFBFBD>ڥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD>ͭ<EFBFBD><EFBFBD>(&O)
menutrans To\ &Next\ error<Tab>]s <09><><EFBFBD>Υ<EFBFBD><EFBFBD>(&N)<Tab>]s
menutrans To\ &Previous\ error<Tab>[s <09><><EFBFBD>Υ<EFBFBD><EFBFBD>(&P)<Tab>[s
menutrans Suggest\ &Corrections<Tab>z? <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&C)<Tab>z?
menutrans &Repeat\ correction<Tab>:spellrepall <09><><EFBFBD><EFBFBD><EFBFBD>򷫤<EFBFBD><F2B7ABA4>֤<EFBFBD>(&R)<Tab>:spellrepall
menutrans Set\ language\ to\ "en" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en"\ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
menutrans Set\ language\ to\ "en_au" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_au"\ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
menutrans Set\ language\ to\ "en_ca" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_ca"\ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
menutrans Set\ language\ to\ "en_gb" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_gb"\ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
menutrans Set\ language\ to\ "en_nz" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_nz"\ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
menutrans Set\ language\ to\ "en_us" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_us"\ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
menutrans &Find\ More\ Languages ¾<>θ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>򸡺<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&F)
" Tools.Fold Menu " Tools.Fold Menu
menutrans &Folding <09>޾<EFBFBD><DEBE><EFBFBD>(&F) menutrans &Folding <09>޾<EFBFBD><DEBE><EFBFBD>(&F)

View File

@@ -2,7 +2,7 @@
" "
" Menu Translations: Japanese (CP932) " Menu Translations: Japanese (CP932)
" Translated By: MURAOKA Taro <koron@tka.att.ne.jp> " Translated By: MURAOKA Taro <koron@tka.att.ne.jp>
" Last Change: 29-Apr-2004. " Last Change: 04-Feb-2006.
" Quit when menu translations have already been done. " Quit when menu translations have already been done.
if exists("did_menu_trans") if exists("did_menu_trans")
@@ -142,7 +142,23 @@ menutrans &Open<Tab>:copen
menutrans &Close<Tab>:cclose <09>‚<EFBFBD><C282><EFBFBD>(&C)<Tab>:cclose menutrans &Close<Tab>:cclose <09>‚<EFBFBD><C282><EFBFBD>(&C)<Tab>:cclose
menutrans &Convert\ to\ HEX<Tab>:%!xxd HEX<EFBFBD>֕ϊ<EFBFBD>(&C)<Tab>:%!xxd menutrans &Convert\ to\ HEX<Tab>:%!xxd HEX<EFBFBD>֕ϊ<EFBFBD>(&C)<Tab>:%!xxd
menutrans Conve&rt\ back<Tab>:%!xxd\ -r HEX<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD>ϊ<EFBFBD>(&R)<Tab>%!xxd\ -r menutrans Conve&rt\ back<Tab>:%!xxd\ -r HEX<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD>ϊ<EFBFBD>(&R)<Tab>%!xxd\ -r
menutrans &Set\ Compiler <09>R<EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>C<EFBFBD><EFBFBD><EFBFBD>ݒ<EFBFBD>(&S) menutrans Se&T\ Compiler <09>R<EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>C<EFBFBD><EFBFBD><EFBFBD>ݒ<EFBFBD>(&T)
" Tools.Spelling Menu
menutrans &Spelling <09>X<EFBFBD>y<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>O(&S)
menutrans &Spell\ Check\ On <09>X<EFBFBD>y<EFBFBD><EFBFBD><EFBFBD>`<60>F<EFBFBD>b<EFBFBD>N<EFBFBD>L<EFBFBD><EFBFBD>(&S)
menutrans Spell\ Check\ &Off <09>X<EFBFBD>y<EFBFBD><EFBFBD><EFBFBD>`<60>F<EFBFBD>b<EFBFBD>N<EFBFBD>L<EFBFBD><EFBFBD>(&O)
menutrans To\ &Next\ error<Tab>]s <09><><EFBFBD>̃G<EFBFBD><EFBFBD><EFBFBD>[(&N)<Tab>]s
menutrans To\ &Previous\ error<Tab>[s <09>O<EFBFBD>̃G<EFBFBD><EFBFBD><EFBFBD>[(&P)<Tab>[s
menutrans Suggest\ &Corrections<Tab>z? <09>C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&C)<Tab>z?
menutrans &Repeat\ correction<Tab>:spellrepall <09>C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>J<EFBFBD><EFBFBD><EFBFBD>Ԃ<EFBFBD>(&R)<Tab>:spellrepall
menutrans Set\ language\ to\ "en" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en"\ <20>ɐݒ肷<EFBFBD><EFBFBD>
menutrans Set\ language\ to\ "en_au" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_au"\ <20>ɐݒ肷<EFBFBD><EFBFBD>
menutrans Set\ language\ to\ "en_ca" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_ca"\ <20>ɐݒ肷<EFBFBD><EFBFBD>
menutrans Set\ language\ to\ "en_gb" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_gb"\ <20>ɐݒ肷<EFBFBD><EFBFBD>
menutrans Set\ language\ to\ "en_nz" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_nz"\ <20>ɐݒ肷<EFBFBD><EFBFBD>
menutrans Set\ language\ to\ "en_us" <09><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\ "en_us"\ <20>ɐݒ肷<EFBFBD><EFBFBD>
menutrans &Find\ More\ Languages <09><><EFBFBD>̌<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(&F)
" Tools.Fold Menu " Tools.Fold Menu
menutrans &Folding <09>܏<EFBFBD><DC8F><EFBFBD>(&F) menutrans &Folding <09>܏<EFBFBD><DC8F><EFBFBD>(&F)

View File

@@ -138,7 +138,7 @@ syn keyword gnuplotType boxxy[errorbars] csplines dots fsteps histeps impulses
syn keyword gnuplotType line[s] linesp[oints] points poiinttype sbezier splines steps syn keyword gnuplotType line[s] linesp[oints] points poiinttype sbezier splines steps
" w lt lw ls = optional " w lt lw ls = optional
syn keyword gnuplotType vectors xerr[orbars] xyerr[orbars] yerr[orbars] financebars candlesticks vector syn keyword gnuplotType vectors xerr[orbars] xyerr[orbars] yerr[orbars] financebars candlesticks vector
syn keyword gnuplotType errorb[ars surface syn keyword gnuplotType errorb[ars] surface
syn keyword gnuplotType filledcurve[s] pm3d x1 x2 y1 y2 xy closed syn keyword gnuplotType filledcurve[s] pm3d x1 x2 y1 y2 xy closed
syn keyword gnuplotType at pi front syn keyword gnuplotType at pi front
syn keyword gnuplotType errorlines xerrorlines yerrorlines xyerrorlines syn keyword gnuplotType errorlines xerrorlines yerrorlines xyerrorlines

View File

@@ -87,6 +87,14 @@ static compl_T *compl_first_match = NULL;
static compl_T *compl_curr_match = NULL; static compl_T *compl_curr_match = NULL;
static compl_T *compl_shown_match = NULL; static compl_T *compl_shown_match = NULL;
/* When "compl_leader" is not NULL only matches that start with this string
* are used. */
static char_u *compl_leader = NULL;
static int compl_used_match; /* Selected one of the matches. When
FALSE the match was edited or using
the longest common string. */
/* When the first completion is done "compl_started" is set. When it's /* When the first completion is done "compl_started" is set. When it's
* FALSE the word to be completed must be located. */ * FALSE the word to be completed must be located. */
static int compl_started = FALSE; static int compl_started = FALSE;
@@ -112,9 +120,12 @@ static int ins_compl_make_cyclic __ARGS((void));
static void ins_compl_upd_pum __ARGS((void)); static void ins_compl_upd_pum __ARGS((void));
static void ins_compl_del_pum __ARGS((void)); static void ins_compl_del_pum __ARGS((void));
static int pum_wanted __ARGS((void)); static int pum_wanted __ARGS((void));
static int pum_two_or_more __ARGS((void));
static void ins_compl_dictionaries __ARGS((char_u *dict, char_u *pat, int dir, int flags, int thesaurus)); static void ins_compl_dictionaries __ARGS((char_u *dict, char_u *pat, int dir, int flags, int thesaurus));
static void ins_compl_free __ARGS((void)); static void ins_compl_free __ARGS((void));
static void ins_compl_clear __ARGS((void)); static void ins_compl_clear __ARGS((void));
static int ins_compl_bs __ARGS((void));
static void ins_compl_addleader __ARGS((int c));
static int ins_compl_prep __ARGS((int c)); static int ins_compl_prep __ARGS((int c));
static buf_T *ins_compl_next_buf __ARGS((buf_T *buf, int flag)); static buf_T *ins_compl_next_buf __ARGS((buf_T *buf, int flag));
static int ins_compl_get_exp __ARGS((pos_T *ini, int dir)); static int ins_compl_get_exp __ARGS((pos_T *ini, int dir));
@@ -673,13 +684,26 @@ edit(cmdchar, startln, count)
if (c == K_DOWN && pum_visible()) if (c == K_DOWN && pum_visible())
c = Ctrl_N; c = Ctrl_N;
/* When using BS while the popup menu is wanted and still after the
* character where completion started: Change the subset of matches to
* what matches "compl_leader". */
if (compl_started && pum_wanted() && curwin->w_cursor.col > compl_col)
{
if ((c == K_BS || c == Ctrl_H) && ins_compl_bs())
continue;
/* Editing the word. */
if (!compl_used_match && vim_isprintc(c))
{
ins_compl_addleader(c);
continue;
}
}
/* Prepare for or stop CTRL-X mode. This doesn't do completion, but /* Prepare for or stop CTRL-X mode. This doesn't do completion, but
* it does fix up the text when finishing completion. */ * it does fix up the text when finishing completion. */
if (c != K_IGNORE) if (c != K_IGNORE && ins_compl_prep(c))
{ continue;
if (ins_compl_prep(c))
continue;
}
#endif #endif
/* CTRL-\ CTRL-N goes to Normal mode, /* CTRL-\ CTRL-N goes to Normal mode,
@@ -2159,9 +2183,6 @@ ins_compl_del_pum()
static int static int
pum_wanted() pum_wanted()
{ {
compl_T *compl;
int i;
/* 'completeopt' must contain "menu" */ /* 'completeopt' must contain "menu" */
if (*p_cot == NUL) if (*p_cot == NUL)
return FALSE; return FALSE;
@@ -2173,6 +2194,17 @@ pum_wanted()
#endif #endif
) )
return FALSE; return FALSE;
return TRUE;
}
/*
* Return TRUE if there are two or more matches to be shown in the popup menu.
*/
static int
pum_two_or_more()
{
compl_T *compl;
int i;
/* Don't display the popup menu if there are no matches or there is only /* Don't display the popup menu if there are no matches or there is only
* one (ignoring the original text). */ * one (ignoring the original text). */
@@ -2199,8 +2231,9 @@ ins_compl_show_pum()
int i; int i;
int cur = -1; int cur = -1;
colnr_T col; colnr_T col;
int lead_len = 0;
if (!pum_wanted()) if (!pum_wanted() || !pum_two_or_more())
return; return;
/* Update the screen before drawing the popup menu over it. */ /* Update the screen before drawing the popup menu over it. */
@@ -2211,12 +2244,18 @@ ins_compl_show_pum()
/* Need to build the popup menu list. */ /* Need to build the popup menu list. */
compl_match_arraysize = 0; compl_match_arraysize = 0;
compl = compl_first_match; compl = compl_first_match;
if (compl_leader != NULL)
lead_len = STRLEN(compl_leader);
do do
{ {
if ((compl->cp_flags & ORIGINAL_TEXT) == 0) if ((compl->cp_flags & ORIGINAL_TEXT) == 0
&& (compl_leader == NULL
|| STRNCMP(compl->cp_str, compl_leader, lead_len) == 0))
++compl_match_arraysize; ++compl_match_arraysize;
compl = compl->cp_next; compl = compl->cp_next;
} while (compl != NULL && compl != compl_first_match); } while (compl != NULL && compl != compl_first_match);
if (compl_match_arraysize == 0)
return;
compl_match_array = (char_u **)alloc((unsigned)(sizeof(char_u **) compl_match_array = (char_u **)alloc((unsigned)(sizeof(char_u **)
* compl_match_arraysize)); * compl_match_arraysize));
if (compl_match_array != NULL) if (compl_match_array != NULL)
@@ -2225,7 +2264,10 @@ ins_compl_show_pum()
compl = compl_first_match; compl = compl_first_match;
do do
{ {
if ((compl->cp_flags & ORIGINAL_TEXT) == 0) if ((compl->cp_flags & ORIGINAL_TEXT) == 0
&& (compl_leader == NULL
|| STRNCMP(compl->cp_str, compl_leader,
lead_len) == 0))
{ {
if (compl == compl_shown_match) if (compl == compl_shown_match)
cur = i; cur = i;
@@ -2238,21 +2280,10 @@ ins_compl_show_pum()
else else
{ {
/* popup menu already exists, only need to find the current item.*/ /* popup menu already exists, only need to find the current item.*/
i = 0; for (i = 0; i < compl_match_arraysize; ++i)
compl = compl_first_match; if (compl_match_array[i] == compl_shown_match->cp_str)
do break;
{ cur = i;
if ((compl->cp_flags & ORIGINAL_TEXT) == 0)
{
if (compl == compl_shown_match)
{
cur = i;
break;
}
++i;
}
compl = compl->cp_next;
} while (compl != NULL && compl != compl_first_match);
} }
if (compl_match_array != NULL) if (compl_match_array != NULL)
@@ -2472,6 +2503,8 @@ ins_compl_free()
vim_free(compl_pattern); vim_free(compl_pattern);
compl_pattern = NULL; compl_pattern = NULL;
vim_free(compl_leader);
compl_leader = NULL;
if (compl_first_match == NULL) if (compl_first_match == NULL)
return; return;
@@ -2501,10 +2534,101 @@ ins_compl_clear()
compl_matches = 0; compl_matches = 0;
vim_free(compl_pattern); vim_free(compl_pattern);
compl_pattern = NULL; compl_pattern = NULL;
vim_free(compl_leader);
compl_leader = NULL;
save_sm = -1; save_sm = -1;
edit_submode_extra = NULL; edit_submode_extra = NULL;
} }
/*
* Delete one character before the cursor and make a subset of the matches
* that match now.
* Returns TRUE if the work is done and another char to be got from the user.
*/
static int
ins_compl_bs()
{
char_u *line;
char_u *p;
if (curwin->w_cursor.col <= compl_col + compl_length)
{
/* Deleted more than what was used to find matches, need to look for
* matches all over again. */
ins_compl_free();
compl_started = FALSE;
compl_matches = 0;
}
line = ml_get_curline();
p = line + curwin->w_cursor.col;
mb_ptr_back(line, p);
vim_free(compl_leader);
compl_leader = vim_strnsave(line + compl_col, (p - line) - compl_col);
if (compl_leader != NULL)
{
ins_compl_del_pum();
ins_compl_delete();
ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
if (!compl_started)
{
/* Matches were cleared, need to search for them now. */
if (ins_complete(Ctrl_N) == FAIL)
compl_cont_status = 0;
else
{
/* Remove the completed word again. */
ins_compl_delete();
ins_bytes(compl_leader + curwin->w_cursor.col - compl_col);
}
}
/* Show the popup menu with a different set of matches. */
ins_compl_show_pum();
compl_used_match = FALSE;
return TRUE;
}
return FALSE;
}
/*
* Append one character to the match leader. May reduce the number of
* matches.
*/
static void
ins_compl_addleader(c)
int c;
{
#ifdef FEAT_MBYTE
int cc;
if (has_mbyte && (cc = (*mb_char2len)(c)) > 1)
{
char_u buf[MB_MAXBYTES + 1];
(*mb_char2bytes)(c, buf);
buf[cc] = NUL;
ins_char_bytes(buf, cc);
}
else
#endif
ins_char(c);
vim_free(compl_leader);
compl_leader = vim_strnsave(ml_get_curline() + compl_col,
curwin->w_cursor.col - compl_col);
if (compl_leader != NULL)
{
/* Show the popup menu with a different set of matches. */
ins_compl_del_pum();
ins_compl_show_pum();
compl_used_match = FALSE;
}
}
/* /*
* Prepare for Insert mode completion, or stop it. * Prepare for Insert mode completion, or stop it.
* Called just after typing a character in Insert mode. * Called just after typing a character in Insert mode.
@@ -3290,6 +3414,7 @@ ins_compl_delete()
ins_compl_insert() ins_compl_insert()
{ {
ins_bytes(compl_shown_match->cp_str + curwin->w_cursor.col - compl_col); ins_bytes(compl_shown_match->cp_str + curwin->w_cursor.col - compl_col);
compl_used_match = TRUE;
} }
/* /*
@@ -3317,6 +3442,8 @@ ins_compl_next(allow_get_expansion, count)
int num_matches = -1; int num_matches = -1;
int i; int i;
int todo = count; int todo = count;
compl_T *found_compl = NULL;
int found_end = FALSE;
if (allow_get_expansion) if (allow_get_expansion)
{ {
@@ -3332,32 +3459,46 @@ ins_compl_next(allow_get_expansion, count)
if (compl_shows_dir == FORWARD && compl_shown_match->cp_next != NULL) if (compl_shows_dir == FORWARD && compl_shown_match->cp_next != NULL)
{ {
compl_shown_match = compl_shown_match->cp_next; compl_shown_match = compl_shown_match->cp_next;
if (compl_shown_match->cp_next != NULL found_end = (compl_first_match != NULL
&& compl_shown_match->cp_next == compl_first_match) && (compl_shown_match->cp_next == compl_first_match
break; || compl_shown_match == compl_first_match));
} }
else if (compl_shows_dir == BACKWARD else if (compl_shows_dir == BACKWARD
&& compl_shown_match->cp_prev != NULL) && compl_shown_match->cp_prev != NULL)
{ {
found_end = (compl_shown_match == compl_first_match);
compl_shown_match = compl_shown_match->cp_prev; compl_shown_match = compl_shown_match->cp_prev;
if (compl_shown_match == compl_first_match) found_end |= (compl_shown_match == compl_first_match);
break;
} }
else else
{ {
compl_pending = TRUE; compl_pending = TRUE;
if (allow_get_expansion) if (!allow_get_expansion)
{
num_matches = ins_compl_get_exp(&compl_startpos,
compl_direction);
if (compl_pending)
{
if (compl_direction == compl_shows_dir)
compl_shown_match = compl_curr_match;
}
}
else
return -1; return -1;
num_matches = ins_compl_get_exp(&compl_startpos, compl_direction);
if (compl_pending && compl_direction == compl_shows_dir)
compl_shown_match = compl_curr_match;
found_end = FALSE;
}
if ((compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0
&& compl_leader != NULL
&& STRNCMP(compl_shown_match->cp_str,
compl_leader, STRLEN(compl_leader)) != 0)
++todo;
else
/* Remember a matching item. */
found_compl = compl_shown_match;
/* Stop at the end of the list when we found a usable match. */
if (found_end)
{
if (found_compl != NULL)
{
compl_shown_match = found_compl;
break;
}
todo = 1; /* use first usable match after wrapping around */
} }
} }

View File

@@ -105,8 +105,8 @@ EXTERN colnr_T dollar_vcol INIT(= 0);
* Variables for Insert mode completion. * Variables for Insert mode completion.
*/ */
/* length of the text being completed (this is deleted to be replaced by the /* Length in bytes of the text being completed (this is deleted to be replaced
* match) */ * by the match.) */
EXTERN int compl_length INIT(= 0); EXTERN int compl_length INIT(= 0);
/* Set when character typed while looking for matches and it means we should /* Set when character typed while looking for matches and it means we should

File diff suppressed because it is too large Load Diff

View File

@@ -84,7 +84,7 @@ pum_display(array, size, selected, row, height, col)
} }
/* don't display when we only have room for one line */ /* don't display when we only have room for one line */
if (pum_height <= 1) if (pum_height < 1 || (pum_height == 1 && size > 1))
return; return;
/* Compute the width of the widest match. */ /* Compute the width of the widest match. */

View File

@@ -2566,13 +2566,14 @@ buf_hide(buf)
grep_internal(cmdidx) grep_internal(cmdidx)
cmdidx_T cmdidx; cmdidx_T cmdidx;
{ {
return ((cmdidx == CMD_grep || cmdidx == CMD_grepadd) return ((cmdidx == CMD_grep || cmdidx == CMD_lgrep
|| cmdidx == CMD_grepadd || cmdidx == CMD_lgrepadd)
&& STRCMP("internal", && STRCMP("internal",
*curbuf->b_p_gp == NUL ? p_gp : curbuf->b_p_gp) == 0); *curbuf->b_p_gp == NUL ? p_gp : curbuf->b_p_gp) == 0);
} }
/* /*
* Used for ":make", ":grep" and ":grepadd". * Used for ":make", ":lmake", ":grep", ":lgrep", ":grepadd", and ":lgrepadd"
*/ */
void void
ex_make(eap) ex_make(eap)
@@ -2581,14 +2582,19 @@ ex_make(eap)
char_u *fname; char_u *fname;
char_u *cmd; char_u *cmd;
unsigned len; unsigned len;
win_T *wp = NULL;
qf_info_T *qi;
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
char_u *au_name = NULL; char_u *au_name = NULL;
switch (eap->cmdidx) switch (eap->cmdidx)
{ {
case CMD_make: au_name = (char_u *)"make"; break; case CMD_make: au_name = (char_u *)"make"; break;
case CMD_lmake: au_name = (char_u *)"lmake"; break;
case CMD_grep: au_name = (char_u *)"grep"; break; case CMD_grep: au_name = (char_u *)"grep"; break;
case CMD_lgrep: au_name = (char_u *)"lgrep"; break;
case CMD_grepadd: au_name = (char_u *)"grepadd"; break; case CMD_grepadd: au_name = (char_u *)"grepadd"; break;
case CMD_lgrepadd: au_name = (char_u *)"lgrepadd"; break;
default: break; default: break;
} }
if (au_name != NULL) if (au_name != NULL)
@@ -2609,6 +2615,15 @@ ex_make(eap)
return; return;
} }
if (eap->cmdidx == CMD_lmake || eap->cmdidx == CMD_lgrep
|| eap->cmdidx == CMD_lgrepadd)
{
qi = ll_get_or_alloc_list(curwin);
if (qi == NULL)
return;
wp = curwin;
}
autowrite_all(); autowrite_all();
fname = get_mef_name(); fname = get_mef_name();
if (fname == NULL) if (fname == NULL)
@@ -2647,10 +2662,12 @@ ex_make(eap)
(void)char_avail(); (void)char_avail();
#endif #endif
if (qf_init(NULL, fname, eap->cmdidx != CMD_make ? p_gefm : p_efm, if (qf_init(wp, fname, (eap->cmdidx != CMD_make
eap->cmdidx != CMD_grepadd) > 0 && eap->cmdidx != CMD_lmake) ? p_gefm : p_efm,
(eap->cmdidx != CMD_grepadd
&& eap->cmdidx != CMD_lgrepadd)) > 0
&& !eap->forceit) && !eap->forceit)
qf_jump(NULL, 0, 0, FALSE); /* display first error */ qf_jump(wp, 0, 0, FALSE); /* display first error */
mch_remove(fname); mch_remove(fname);
vim_free(fname); vim_free(fname);
@@ -2832,6 +2849,9 @@ ex_cfile(eap)
/* /*
* ":vimgrep {pattern} file(s)" * ":vimgrep {pattern} file(s)"
* ":vimgrepadd {pattern} file(s)"
* ":lvimgrep {pattern} file(s)"
* ":lvimgrepadd {pattern} file(s)"
*/ */
void void
ex_vimgrep(eap) ex_vimgrep(eap)
@@ -2843,7 +2863,9 @@ ex_vimgrep(eap)
char_u *s; char_u *s;
char_u *p; char_u *p;
int fi; int fi;
qf_info_T *qi = &ql_info;
qfline_T *prevp = NULL; qfline_T *prevp = NULL;
win_T *wp = NULL;
long lnum; long lnum;
buf_T *buf; buf_T *buf;
int duplicate_name = FALSE; int duplicate_name = FALSE;
@@ -2859,12 +2881,13 @@ ex_vimgrep(eap)
char_u *au_name = NULL; char_u *au_name = NULL;
int flags = 0; int flags = 0;
colnr_T col; colnr_T col;
qf_info_T *qi = &ql_info;
switch (eap->cmdidx) switch (eap->cmdidx)
{ {
case CMD_vimgrep: au_name = (char_u *)"vimgrep"; break; case CMD_vimgrep: au_name = (char_u *)"vimgrep"; break;
case CMD_lvimgrep: au_name = (char_u *)"lvimgrep"; break;
case CMD_vimgrepadd: au_name = (char_u *)"vimgrepadd"; break; case CMD_vimgrepadd: au_name = (char_u *)"vimgrepadd"; break;
case CMD_lvimgrepadd: au_name = (char_u *)"lvimgrepadd"; break;
default: break; default: break;
} }
if (au_name != NULL) if (au_name != NULL)
@@ -2876,6 +2899,15 @@ ex_vimgrep(eap)
} }
#endif #endif
if (eap->cmdidx == CMD_grep || eap->cmdidx == CMD_lvimgrep
|| eap->cmdidx == CMD_lgrepadd || eap->cmdidx == CMD_lvimgrepadd)
{
qi = ll_get_or_alloc_list(curwin);
if (qi == NULL)
return;
wp = curwin;
}
/* Get the search pattern: either white-separated or enclosed in // */ /* Get the search pattern: either white-separated or enclosed in // */
regmatch.regprog = NULL; regmatch.regprog = NULL;
p = skip_vimgrep_pat(eap->arg, &s, &flags); p = skip_vimgrep_pat(eap->arg, &s, &flags);
@@ -2897,7 +2929,8 @@ ex_vimgrep(eap)
goto theend; goto theend;
} }
if ((eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_vimgrepadd) if ((eap->cmdidx != CMD_grepadd && eap->cmdidx != CMD_lgrepadd &&
eap->cmdidx != CMD_vimgrepadd && eap->cmdidx != CMD_lvimgrepadd)
|| qi->qf_curlist == qi->qf_listcount) || qi->qf_curlist == qi->qf_listcount)
/* make place for a new list */ /* make place for a new list */
qf_new_list(qi); qf_new_list(qi);
@@ -3072,7 +3105,7 @@ ex_vimgrep(eap)
if (qi->qf_lists[qi->qf_curlist].qf_count > 0) if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
{ {
if ((flags & VGR_NOJUMP) == 0) if ((flags & VGR_NOJUMP) == 0)
qf_jump(NULL, 0, 0, eap->forceit); qf_jump(wp, 0, 0, eap->forceit);
} }
else else
EMSG2(_(e_nomatch2), s); EMSG2(_(e_nomatch2), s);
@@ -3396,7 +3429,9 @@ set_errorlist(wp, list, action)
/* /*
* ":[range]cbuffer [bufnr]" command. * ":[range]cbuffer [bufnr]" command.
* ":[range]caddbuffer [bufnr]" command.
* ":[range]lbuffer [bufnr]" command. * ":[range]lbuffer [bufnr]" command.
* ":[range]laddbuffer [bufnr]" command.
*/ */
void void
ex_cbuffer(eap) ex_cbuffer(eap)
@@ -3405,7 +3440,7 @@ ex_cbuffer(eap)
buf_T *buf = NULL; buf_T *buf = NULL;
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
if (eap->cmdidx == CMD_lbuffer) if (eap->cmdidx == CMD_lbuffer || eap->cmdidx == CMD_laddbuffer)
{ {
qi = ll_get_or_alloc_list(curwin); qi = ll_get_or_alloc_list(curwin);
if (qi == NULL) if (qi == NULL)
@@ -3431,7 +3466,10 @@ ex_cbuffer(eap)
|| eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count) || eap->line2 < 1 || eap->line2 > buf->b_ml.ml_line_count)
EMSG(_(e_invrange)); EMSG(_(e_invrange));
else else
qf_init_ext(qi, NULL, buf, NULL, p_efm, TRUE, eap->line1, eap->line2); qf_init_ext(qi, NULL, buf, NULL, p_efm,
(eap->cmdidx == CMD_cbuffer
|| eap->cmdidx == CMD_lbuffer),
eap->line1, eap->line2);
} }
} }

View File

@@ -36,5 +36,5 @@
#define VIM_VERSION_NODOT "vim70aa" #define VIM_VERSION_NODOT "vim70aa"
#define VIM_VERSION_SHORT "7.0aa" #define VIM_VERSION_SHORT "7.0aa"
#define VIM_VERSION_MEDIUM "7.0aa ALPHA" #define VIM_VERSION_MEDIUM "7.0aa ALPHA"
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 3)" #define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 4)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 3, compiled " #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2006 Feb 4, compiled "