1
0
forked from aniani/vim

updated for version 7.0129

This commit is contained in:
Bram Moolenaar
2005-08-12 19:59:19 +00:00
parent e5b8e3d3c6
commit 90cfdbe040
18 changed files with 277 additions and 102 deletions

View File

@@ -2367,12 +2367,12 @@ keymap_init()
# ifdef FEAT_MBYTE
/* try finding "keymap/'keymap'_'encoding'.vim" in 'runtimepath' */
sprintf((char *)buf, "keymap/%s_%s.vim", curbuf->b_p_keymap, p_enc);
if (cmd_runtime(buf, FALSE) == FAIL)
if (source_runtime(buf, FALSE) == FAIL)
# endif
{
/* try finding "keymap/'keymap'.vim" in 'runtimepath' */
sprintf((char *)buf, "keymap/%s.vim", curbuf->b_p_keymap);
if (cmd_runtime(buf, FALSE) == FAIL)
if (source_runtime(buf, FALSE) == FAIL)
{
vim_free(buf);
return (char_u *)N_("E544: Keymap file not found");

View File

@@ -17775,7 +17775,7 @@ script_autoload(name, reload)
}
/* Try loading the package from $VIMRUNTIME/autoload/<name>.vim */
if (cmd_runtime(scriptname, FALSE) == OK)
if (source_runtime(scriptname, FALSE) == OK)
ret = TRUE;
}

View File

@@ -2391,7 +2391,7 @@ ex_compiler(eap)
do_unlet((char_u *)"b:current_compiler", TRUE);
sprintf((char *)buf, "compiler/%s.vim", eap->arg);
if (cmd_runtime(buf, TRUE) == FAIL)
if (source_runtime(buf, TRUE) == FAIL)
EMSG2(_("E666: compiler not supported: %s"), eap->arg);
vim_free(buf);
@@ -2426,7 +2426,7 @@ ex_compiler(eap)
ex_runtime(eap)
exarg_T *eap;
{
cmd_runtime(eap->arg, eap->forceit);
source_runtime(eap->arg, eap->forceit);
}
static void source_callback __ARGS((char_u *fname, void *cookie));
@@ -2447,7 +2447,7 @@ source_callback(fname, cookie)
* return FAIL when no file could be sourced, OK otherwise.
*/
int
cmd_runtime(name, all)
source_runtime(name, all)
char_u *name;
int all;
{

View File

@@ -4151,14 +4151,14 @@ ExpandGeneric(xp, regmatch, num_file, file, func)
{
int i;
int count = 0;
int loop;
int round;
char_u *str;
/* do this loop twice:
* loop == 0: count the number of matching names
* loop == 1: copy the matching names into allocated memory
* round == 0: count the number of matching names
* round == 1: copy the matching names into allocated memory
*/
for (loop = 0; loop <= 1; ++loop)
for (round = 0; round <= 1; ++round)
{
for (i = 0; ; ++i)
{
@@ -4170,7 +4170,7 @@ ExpandGeneric(xp, regmatch, num_file, file, func)
if (vim_regexec(regmatch, str, (colnr_T)0))
{
if (loop)
if (round)
{
str = vim_strsave_escaped(str, (char_u *)" \t\\.");
(*file)[count] = str;
@@ -4187,7 +4187,7 @@ ExpandGeneric(xp, regmatch, num_file, file, func)
++count;
}
}
if (loop == 0)
if (round == 0)
{
if (count == 0)
return OK;
@@ -4201,6 +4201,10 @@ ExpandGeneric(xp, regmatch, num_file, file, func)
count = 0;
}
}
/* Sort the results. */
sort_strings(*file, *num_file);
return OK;
}

View File

@@ -550,7 +550,7 @@ main
*/
if (p_lpl)
{
cmd_runtime((char_u *)"plugin/*.vim", TRUE);
source_runtime((char_u *)"plugin/*.vim", TRUE);
TIME_MSG("loading plugins");
}
#endif

View File

@@ -1160,7 +1160,14 @@ do_execreg(regname, colon, addcr)
p = vim_strsave_escaped_ext(last_cmdline,
(char_u *)"\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037", Ctrl_V, FALSE);
if (p != NULL)
retval = put_in_typebuf(p, TRUE);
{
/* When in Visual mode "'<,'>" will be prepended to the command.
* Remove it when it's already there. */
if (VIsual_active && STRNCMP(p, "'<,'>", 5) == 0)
retval = put_in_typebuf(p + 5, TRUE);
else
retval = put_in_typebuf(p, TRUE);
}
vim_free(p);
}
#endif

View File

@@ -5793,25 +5793,6 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
}
#endif
#ifdef FEAT_AUTOCMD
# ifdef FEAT_SYN_HL
/* When 'syntax' is set, load the syntax of that name */
else if (varp == &(curbuf->b_p_syn))
{
apply_autocmds(EVENT_SYNTAX, curbuf->b_p_syn,
curbuf->b_fname, TRUE, curbuf);
}
# endif
/* When 'filetype' is set, trigger the FileType autocommands of that name */
else if (varp == &(curbuf->b_p_ft))
{
did_filetype = TRUE;
apply_autocmds(EVENT_FILETYPE, curbuf->b_p_ft,
curbuf->b_fname, TRUE, curbuf);
}
#endif
#ifdef FEAT_QUICKFIX
/* When 'bufhidden' is set, check for valid value. */
else if (gvarp == &p_bh)
@@ -6159,6 +6140,46 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
/* May set global value for local option. */
else if (!(opt_flags & OPT_LOCAL) && opt_flags != OPT_GLOBAL)
set_string_option_global(opt_idx, varp);
#ifdef FEAT_AUTOCMD
/*
* Trigger the autocommand only after setting the flags.
*/
# ifdef FEAT_SYN_HL
/* When 'syntax' is set, load the syntax of that name */
if (varp == &(curbuf->b_p_syn))
{
apply_autocmds(EVENT_SYNTAX, curbuf->b_p_syn,
curbuf->b_fname, TRUE, curbuf);
}
# endif
else if (varp == &(curbuf->b_p_ft))
{
/* 'filetype' is set, trigger the FileType autocommand */
did_filetype = TRUE;
apply_autocmds(EVENT_FILETYPE, curbuf->b_p_ft,
curbuf->b_fname, TRUE, curbuf);
}
#endif
#ifdef FEAT_SYN_HL
if (varp == &(curbuf->b_p_spl))
{
char_u fname[200];
/*
* Source the spell/LANG.vim in 'runtimepath'.
* They could set 'spellcapcheck' depending on the language.
* Use the first name in 'spelllang' up to '_region' or
* '.encoding'.
*/
for (p = curbuf->b_p_spl; *p != NUL; ++p)
if (vim_strchr((char_u *)"_.,", *p) != NULL)
break;
vim_snprintf((char *)fname, 200, "spell/%.*s.vim",
(int)(p - curbuf->b_p_spl), curbuf->b_p_spl);
source_runtime(fname, TRUE);
}
#endif
}
#ifdef FEAT_MOUSE

View File

@@ -605,7 +605,7 @@ msgid "E742: Cannot change value of %s"
msgstr "E742: Non riesco a cambiare il valore di %s"
msgid "E698: variable nested too deep for making a copy"
msgstr "E698 Variabile troppo nidificata per poterla copiare"
msgstr "E698: Variabile troppo nidificata per poterla copiare"
#, c-format
msgid "E124: Missing '(': %s"

View File

@@ -53,7 +53,7 @@ void ex_argdelete __ARGS((exarg_T *eap));
void ex_listdo __ARGS((exarg_T *eap));
void ex_compiler __ARGS((exarg_T *eap));
void ex_runtime __ARGS((exarg_T *eap));
int cmd_runtime __ARGS((char_u *name, int all));
int source_runtime __ARGS((char_u *name, int all));
int do_in_runtimepath __ARGS((char_u *name, int all, void (*callback)(char_u *fname, void *ck), void *cookie));
void ex_options __ARGS((exarg_T *eap));
void ex_source __ARGS((exarg_T *eap));

View File

@@ -4421,7 +4421,7 @@ syn_cmd_include(eap, syncing)
prev_toplvl_grp = curbuf->b_syn_topgrp;
curbuf->b_syn_topgrp = sgl_id;
if (source ? do_source(eap->arg, FALSE, FALSE) == FAIL
: cmd_runtime(eap->arg, TRUE) == FAIL)
: source_runtime(eap->arg, TRUE) == FAIL)
EMSG2(_(e_notopen), eap->arg);
curbuf->b_syn_topgrp = prev_toplvl_grp;
current_syn_inc_tag = prev_syn_inc_tag;
@@ -6174,7 +6174,7 @@ init_highlight(both, reset)
else
{
++recursive;
(void)cmd_runtime((char_u *)"syntax/syncolor.vim", TRUE);
(void)source_runtime((char_u *)"syntax/syncolor.vim", TRUE);
--recursive;
}
}
@@ -6204,7 +6204,7 @@ load_colors(name)
if (buf != NULL)
{
sprintf((char *)buf, "colors/%s.vim", name);
retval = cmd_runtime(buf, FALSE);
retval = source_runtime(buf, FALSE);
vim_free(buf);
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_COLORSCHEME, NULL, NULL, FALSE, curbuf);

View File

@@ -36,5 +36,5 @@
#define VIM_VERSION_NODOT "vim70aa"
#define VIM_VERSION_SHORT "7.0aa"
#define VIM_VERSION_MEDIUM "7.0aa ALPHA"
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 11)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 11, compiled "
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 12)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 12, compiled "