aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/doc/options.txt2
-rw-r--r--src/nvim/buffer.c4
-rw-r--r--src/nvim/option.c10
3 files changed, 9 insertions, 7 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 3c45a3f525..1c162f73f3 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -5561,7 +5561,7 @@ A jump table for the options with a short description can be found at |Q_op|.
After this option has been set successfully, Vim will source the files
"spell/LANG.vim" in 'runtimepath'. "LANG" is the value of 'spelllang'
- up to the first comma, dot or underscore.
+ up to the first character that is not an ASCII letter and not a dash.
Also see |set-spc-auto|.
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index b77bae47a9..ad1170e718 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -4945,11 +4945,11 @@ chk_modeline (
save_SID = current_SID;
current_SID = SID_MODELINE;
// Make sure no risky things are executed as a side effect.
- sandbox++;
+ ++secure;
retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
- sandbox--;
+ --secure;
current_SID = save_SID;
if (retval == FAIL) /* stop if error found */
break;
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 0f6408c9d4..af2fe33505 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -3296,11 +3296,13 @@ ambw_end:
* '.encoding'.
*/
for (p = q; *p != NUL; ++p)
- if (vim_strchr((char_u *)"_.,", *p) != NULL)
+ if (!ASCII_ISALPHA(*p) && *p != '-')
break;
- vim_snprintf((char *)fname, sizeof(fname), "spell/%.*s.vim",
- (int)(p - q), q);
- source_runtime(fname, DIP_ALL);
+ if (p > q) {
+ vim_snprintf((char *)fname, sizeof(fname), "spell/%.*s.vim",
+ (int)(p - q), q);
+ source_runtime(fname, DIP_ALL);
+ }
}
}