]> granicus.if.org Git - vim/commitdiff
patch 8.0.0104 v8.0.0104
authorBram Moolenaar <Bram@vim.org>
Sat, 26 Nov 2016 16:45:53 +0000 (17:45 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 26 Nov 2016 16:45:53 +0000 (17:45 +0100)
Problem:    Value of 'thesaurus' option not checked properly.
Solution:   Add P_NDNAME flag. (Daisuke Suzuki)

src/option.c
src/testdir/test_options.vim
src/version.c

index 5b6dbe358c16e75c54281ad126e1ddcf8fe32ae0..fae10b6a2ea4da0491f7e04dd7e768e246767188 100644 (file)
@@ -2660,7 +2660,7 @@ static struct vimoption options[] =
     {"textwidth",   "tw",   P_NUM|P_VI_DEF|P_VIM|P_RBUF,
                            (char_u *)&p_tw, PV_TW,
                            {(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
-    {"thesaurus",   "tsr",  P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP,
+    {"thesaurus",   "tsr",  P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NDNAME,
 #ifdef FEAT_INS_EXPAND
                            (char_u *)&p_tsr, PV_TSR,
 #else
index 88be8f9c5f084ca0b9c9bc97a76fb52d2ca974e5..6dfb1bbe6006183088959f277035d201ac84090d 100644 (file)
@@ -107,17 +107,25 @@ func Test_keymap_valid()
   call assert_fails(":set kmp=trunc\x00name", "trunc")
 endfunc
 
-func Test_dictionary()
+func Check_dir_option(name)
   " Check that it's possible to set the option.
-  set dictionary=/usr/share/dict/words
-  call assert_equal('/usr/share/dict/words', &dictionary)
-  set dictionary=/usr/share/dict/words,/and/there
-  call assert_equal('/usr/share/dict/words,/and/there', &dictionary)
-  set dictionary=/usr/share/dict\ words
-  call assert_equal('/usr/share/dict words', &dictionary)
+  exe 'set ' . a:name . '=/usr/share/dict/words'
+  call assert_equal('/usr/share/dict/words', eval('&' . a:name))
+  exe 'set ' . a:name . '=/usr/share/dict/words,/and/there'
+  call assert_equal('/usr/share/dict/words,/and/there', eval('&' . a:name))
+  exe 'set ' . a:name . '=/usr/share/dict\ words'
+  call assert_equal('/usr/share/dict words', eval('&' . a:name))
 
   " Check rejecting weird characters.
-  call assert_fails("set dictionary=/not&there", "E474:")
-  call assert_fails("set dictionary=/not>there", "E474:")
-  call assert_fails("set dictionary=/not.*there", "E474:")
+  call assert_fails("set " . a:name . "=/not&there", "E474:")
+  call assert_fails("set " . a:name . "=/not>there", "E474:")
+  call assert_fails("set " . a:name . "=/not.*there", "E474:")
+endfunc
+
+func Test_dictionary()
+  call Check_dir_option('dictionary')
+endfunc
+
+func Test_thesaurus()
+  call Check_dir_option('thesaurus')
 endfunc
index 4dcbcfb733840c3cdf4630672cae96f2b767e1e1..0e3554ddcba1d6968431c0d78b91c26ad9846518 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    104,
 /**/
     103,
 /**/