summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-08-04 20:55:44 +0200
committerBram Moolenaar <Bram@vim.org>2010-08-04 20:55:44 +0200
commit5c3bd0a0fbf982c230cbf06304d4c9e0b5e40065 (patch)
tree1b65a00d9d0fb19e8f2f1da14ee0ce28c885f74b
parente4ce65d445c45e14903b9daf08ee8658cb0f3090 (diff)
Disallow setting 'ambiwidth' to "double" when 'listchars' or 'fillchars'
contains a character that would become double width.
-rw-r--r--runtime/doc/options.txt5
-rw-r--r--src/option.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 5f57ed5802..b1539bbe04 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.3e. Last change: 2010 Aug 01
+*options.txt* For Vim version 7.3e. Last change: 2010 Aug 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -665,6 +665,9 @@ A jump table for the options with a short description can be found at |Q_op|.
"single": Use the same width as characters in US-ASCII. This is
expected by most users.
"double": Use twice the width of ASCII characters.
+ *E834* *E835*
+ The value "double" cannot be used if 'listchars' or 'fillchars'
+ contains a character that would be double width.
There are a number of CJK fonts for which the width of glyphs for
those characters are solely based on how many octets they take in
diff --git a/src/option.c b/src/option.c
index fc384536a7..b137fa4530 100644
--- a/src/option.c
+++ b/src/option.c
@@ -5745,6 +5745,12 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
{
if (check_opt_strings(p_ambw, p_ambw_values, FALSE) != OK)
errmsg = e_invarg;
+ else if (set_chars_option(&p_lcs) != NULL)
+ errmsg = (char_u *)_("E834: Conflicts with value of 'listchars'");
+# if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
+ else if (set_chars_option(&p_fcs) != NULL)
+ errmsg = (char_u *)_("E835: Conflicts with value of 'fillchars'");
+# endif
}
#endif