1
0
forked from aniani/vim

updated for version 7.0220

This commit is contained in:
Bram Moolenaar
2006-03-10 21:46:58 +00:00
parent a94bc430e8
commit ade0083d3a
5 changed files with 100 additions and 50 deletions

View File

@@ -467,6 +467,7 @@ static void f_char2nr __ARGS((typval_T *argvars, typval_T *rettv));
static void f_cindent __ARGS((typval_T *argvars, typval_T *rettv));
static void f_col __ARGS((typval_T *argvars, typval_T *rettv));
#if defined(FEAT_INS_EXPAND)
static void f_complete __ARGS((typval_T *argvars, typval_T *rettv));
static void f_complete_add __ARGS((typval_T *argvars, typval_T *rettv));
static void f_complete_check __ARGS((typval_T *argvars, typval_T *rettv));
#endif
@@ -6884,6 +6885,7 @@ static struct fst
{"cindent", 1, 1, f_cindent},
{"col", 1, 1, f_col},
#if defined(FEAT_INS_EXPAND)
{"complete", 2, 2, f_complete},
{"complete_add", 1, 1, f_complete_add},
{"complete_check", 0, 0, f_complete_check},
#endif
@@ -8101,6 +8103,35 @@ f_col(argvars, rettv)
}
#if defined(FEAT_INS_EXPAND)
/*
* "complete()" function
*/
/*ARGSUSED*/
static void
f_complete(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
int startcol;
if ((State & INSERT) == 0)
{
EMSG(_("E785: complete() can only be used in Insert mode"));
return;
}
if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL)
{
EMSG(_(e_invarg));
return;
}
startcol = get_tv_number_chk(&argvars[0], NULL);
if (startcol <= 0)
return;
set_completion(startcol - 1, argvars[1].vval.v_list);
}
/*
* "complete_add()" function
*/

View File

@@ -949,9 +949,14 @@ do_bang(addr_count, eap, forceit, do_in, do_out)
do_shell(newcmd, 0);
}
else /* :range! */
{
/* Careful: This may recursively call do_bang() again! (because of
* autocommands) */
do_filter(line1, line2, eap, newcmd, do_in, do_out);
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_SHELLFILTERPOST, NULL, NULL, FALSE, curbuf);
#endif
}
if (free_newcmd)
vim_free(newcmd);
}
@@ -1419,6 +1424,10 @@ do_shell(cmd, flags)
/* display any error messages now */
display_errors();
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_SHELLCMDPOST, NULL, NULL, FALSE, curbuf);
#endif
}
/*

View File

@@ -9,6 +9,7 @@ void backspace_until_column __ARGS((int col));
int vim_is_ctrl_x_key __ARGS((int c));
int ins_compl_add_infercase __ARGS((char_u *str, int len, int icase, char_u *fname, int dir, int flags));
int ins_compl_add __ARGS((char_u *str, int len, int icase, char_u *fname, char_u *extra, int cdir, int flags));
void set_completion __ARGS((int startcol, list_T *list));
void ins_compl_show_pum __ARGS((void));
char_u *find_word_start __ARGS((char_u *ptr));
char_u *find_word_end __ARGS((char_u *ptr));