summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-08-12 19:59:19 +0000
committerBram Moolenaar <Bram@vim.org>2005-08-12 19:59:19 +0000
commit90cfdbe040320952e6b542d0633987f082b0f158 (patch)
tree2063faaaf71645ca7c2cb575ca612e3b664fa988 /src
parente5b8e3d3c6139c53c8aea63471e7d0285ab748e0 (diff)
downloadvim-90cfdbe040320952e6b542d0633987f082b0f158.zip
updated for version 7.0129
Diffstat (limited to 'src')
-rw-r--r--src/digraph.c4
-rw-r--r--src/eval.c2
-rw-r--r--src/ex_cmds2.c6
-rw-r--r--src/ex_getln.c16
-rw-r--r--src/main.c2
-rw-r--r--src/ops.c9
-rw-r--r--src/option.c59
-rw-r--r--src/po/it.po2
-rw-r--r--src/proto/ex_cmds2.pro2
-rw-r--r--src/syntax.c6
-rw-r--r--src/version.h4
11 files changed, 72 insertions, 40 deletions
diff --git a/src/digraph.c b/src/digraph.c
index 93a80a8b1..2f1bcda82 100644
--- a/src/digraph.c
+++ b/src/digraph.c
@@ -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");
diff --git a/src/eval.c b/src/eval.c
index 6b8d736ef..cd706b49c 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -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;
}
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 861fa8186..bd8d748e8 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -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;
{
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 3c5ad94c1..5ba7d8b07 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -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;
}
diff --git a/src/main.c b/src/main.c
index 380a57289..0067b1c2f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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
diff --git a/src/ops.c b/src/ops.c
index 6fc4f7514..8be36e841 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -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
diff --git a/src/option.c b/src/option.c
index d1444fbf4..67bcf5eee 100644
--- a/src/option.c
+++ b/src/option.c
@@ -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
diff --git a/src/po/it.po b/src/po/it.po
index a97354a76..ee0becf45 100644
--- a/src/po/it.po
+++ b/src/po/it.po
@@ -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"
diff --git a/src/proto/ex_cmds2.pro b/src/proto/ex_cmds2.pro
index 88fa352b7..cc5664384 100644
--- a/src/proto/ex_cmds2.pro
+++ b/src/proto/ex_cmds2.pro
@@ -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));
diff --git a/src/syntax.c b/src/syntax.c
index 0c714d1bb..4c4cbadba 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -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);
diff --git a/src/version.h b/src/version.h
index 9d047e0c6..d929fcc09 100644
--- a/src/version.h
+++ b/src/version.h
@@ -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 "