summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-11-12 04:44:01 +0100
committerBram Moolenaar <Bram@vim.org>2013-11-12 04:44:01 +0100
commitcc63c647eee82ca4f3a9c7b09c1bd86933e913d4 (patch)
tree1568b983900ab159817a190316b18f511d2a9ade /src/option.c
parentefe06f4dd8713e5a8dc8c537b0fdf89101a87c20 (diff)
downloadvim-git-cc63c647eee82ca4f3a9c7b09c1bd86933e913d4.tar.gz
updated for version 7.4.088v7.4.088
Problem: When spell checking is enabled Asian characters are always marked as error. Solution: When 'spelllang' contains "cjk" do not mark Asian characters as error. (Ken Takata)
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/option.c b/src/option.c
index 589e13444..4e087a58b 100644
--- a/src/option.c
+++ b/src/option.c
@@ -7122,6 +7122,11 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
if (varp == &(curwin->w_s->b_p_spl))
{
char_u fname[200];
+ char_u *q = curwin->w_s->b_p_spl;
+
+ /* Skip the first name if it is "cjk". */
+ if (STRNCMP(q, "cjk,", 4) == 0)
+ q += 4;
/*
* Source the spell/LANG.vim in 'runtimepath'.
@@ -7129,11 +7134,10 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
* Use the first name in 'spelllang' up to '_region' or
* '.encoding'.
*/
- for (p = curwin->w_s->b_p_spl; *p != NUL; ++p)
+ for (p = q; *p != NUL; ++p)
if (vim_strchr((char_u *)"_.,", *p) != NULL)
break;
- vim_snprintf((char *)fname, 200, "spell/%.*s.vim",
- (int)(p - curwin->w_s->b_p_spl), curwin->w_s->b_p_spl);
+ vim_snprintf((char *)fname, 200, "spell/%.*s.vim", (int)(p - q), q);
source_runtime(fname, TRUE);
}
#endif