Mercurial > vim
annotate src/optionstr.c @ 29509:d61007cc39b3 v9.0.0096
patch 9.0.0096: flag "new_value_alloced" is always true
Commit: https://github.com/vim/vim/commit/f6782732ab4acd02211923fbdccb457dacaf277e
Author: zeertzjq <zeertzjq@outlook.com>
Date: Wed Jul 27 18:26:03 2022 +0100
patch 9.0.0096: flag "new_value_alloced" is always true
Problem: Flag "new_value_alloced" is always true.
Solution: Remove "new_value_alloced". (closes https://github.com/vim/vim/issues/10792)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 27 Jul 2022 19:30:03 +0200 |
parents | caaf5b270018 |
children | 6b8aaf16af99 |
rev | line source |
---|---|
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 /* vi:set ts=8 sts=4 sw=4 noet: |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 * |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 * VIM - Vi IMproved by Bram Moolenaar |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 * |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 * Do ":help uganda" in Vim to read copying and usage conditions. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 * Do ":help credits" in Vim to see a list of people who contributed. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 * See README.txt for an overview of the Vim source code. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 * optionstr.c: Functions related to string options |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
12 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
13 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
14 #include "vim.h" |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
15 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
16 static char *(p_ambw_values[]) = {"single", "double", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
17 static char *(p_bg_values[]) = {"light", "dark", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
18 static char *(p_bkc_values[]) = {"yes", "auto", "no", "breaksymlink", "breakhardlink", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
19 static char *(p_bo_values[]) = {"all", "backspace", "cursor", "complete", |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
20 "copy", "ctrlg", "error", "esc", "ex", |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
21 "hangul", "insertmode", "lang", "mess", |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
22 "showmatch", "operator", "register", "shell", |
28439
16bd027b039e
patch 8.2.4744: a terminal window can't use the bell
Bram Moolenaar <Bram@vim.org>
parents:
28353
diff
changeset
|
23 "spell", "term", "wildmode", NULL}; |
20613
9edb439adbea
patch 8.2.0860: cannot use CTRL-A and CTRL-X on unsigned numbers
Bram Moolenaar <Bram@vim.org>
parents:
20609
diff
changeset
|
24 static char *(p_nf_values[]) = {"bin", "octal", "hex", "alpha", "unsigned", NULL}; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
25 static char *(p_ff_values[]) = {FF_UNIX, FF_DOS, FF_MAC, NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
26 #ifdef FEAT_CRYPT |
24970
7e9e53a0368f
patch 8.2.3022: available encryption methods are not strong enough
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
27 static char *(p_cm_values[]) = {"zip", "blowfish", "blowfish2", |
7e9e53a0368f
patch 8.2.3022: available encryption methods are not strong enough
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
28 # ifdef FEAT_SODIUM |
7e9e53a0368f
patch 8.2.3022: available encryption methods are not strong enough
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
29 "xchacha20", |
7e9e53a0368f
patch 8.2.3022: available encryption methods are not strong enough
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
30 # endif |
7e9e53a0368f
patch 8.2.3022: available encryption methods are not strong enough
Bram Moolenaar <Bram@vim.org>
parents:
24630
diff
changeset
|
31 NULL}; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
32 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
33 static char *(p_cmp_values[]) = {"internal", "keepascii", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
34 static char *(p_dy_values[]) = {"lastline", "truncate", "uhex", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 #ifdef FEAT_FOLDING |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 static char *(p_fdo_values[]) = {"all", "block", "hor", "mark", "percent", |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 "quickfix", "search", "tag", "insert", |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 "undo", "jump", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 #ifdef FEAT_SESSION |
24464
a56f9c2ba51c
patch 8.2.2772: problems when restoring 'runtimepath' from a session file
Bram Moolenaar <Bram@vim.org>
parents:
24079
diff
changeset
|
41 // Also used for 'viewoptions'! Keep in sync with SSOP_ flags. |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
42 static char *(p_ssop_values[]) = {"buffers", "winpos", "resize", "winsize", |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
43 "localoptions", "options", "help", "blank", "globals", "slash", "unix", |
24464
a56f9c2ba51c
patch 8.2.2772: problems when restoring 'runtimepath' from a session file
Bram Moolenaar <Bram@vim.org>
parents:
24079
diff
changeset
|
44 "sesdir", "curdir", "folds", "cursor", "tabpages", "terminal", "skiprtp", |
a56f9c2ba51c
patch 8.2.2772: problems when restoring 'runtimepath' from a session file
Bram Moolenaar <Bram@vim.org>
parents:
24079
diff
changeset
|
45 NULL}; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
46 #endif |
18646
394abd397e15
patch 8.1.2315: not always using the right window when jumping to an error
Bram Moolenaar <Bram@vim.org>
parents:
18574
diff
changeset
|
47 // Keep in sync with SWB_ flags in option.h |
394abd397e15
patch 8.1.2315: not always using the right window when jumping to an error
Bram Moolenaar <Bram@vim.org>
parents:
18574
diff
changeset
|
48 static char *(p_swb_values[]) = {"useopen", "usetab", "split", "newtab", "vsplit", "uselast", NULL}; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
49 static char *(p_tc_values[]) = {"followic", "ignore", "match", "followscs", "smart", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
50 #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
51 static char *(p_toolbar_values[]) = {"text", "icons", "tooltips", "horiz", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
52 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
53 #if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
54 static char *(p_tbis_values[]) = {"tiny", "small", "medium", "large", "huge", "giant", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
55 #endif |
18354
9f51d0cef8da
patch 8.1.2171: mouse support not always available
Bram Moolenaar <Bram@vim.org>
parents:
18303
diff
changeset
|
56 #if defined(UNIX) || defined(VMS) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
57 static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm", "pterm", "urxvt", "sgr", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
58 #endif |
25380
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
59 static char *(p_ve_values[]) = {"block", "insert", "all", "onemore", "none", "NONE", NULL}; |
27875
ae38d2e81fca
patch 8.2.4463: completion only uses strict matching
Bram Moolenaar <Bram@vim.org>
parents:
27597
diff
changeset
|
60 static char *(p_wop_values[]) = {"fuzzy", "tagfile", "pum", NULL}; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
61 #ifdef FEAT_WAK |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
62 static char *(p_wak_values[]) = {"yes", "menu", "no", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
63 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
64 static char *(p_mousem_values[]) = {"extend", "popup", "popup_setpos", "mac", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
65 static char *(p_sel_values[]) = {"inclusive", "exclusive", "old", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
66 static char *(p_slm_values[]) = {"mouse", "key", "cmd", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
67 static char *(p_km_values[]) = {"startsel", "stopsel", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
68 #ifdef FEAT_BROWSE |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
69 static char *(p_bsdir_values[]) = {"current", "last", "buffer", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
70 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
71 static char *(p_scbopt_values[]) = {"ver", "hor", "jump", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
72 static char *(p_debug_values[]) = {"msg", "throw", "beep", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
73 static char *(p_ead_values[]) = {"both", "ver", "hor", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
74 static char *(p_buftype_values[]) = {"nofile", "nowrite", "quickfix", "help", "terminal", "acwrite", "prompt", "popup", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
75 static char *(p_bufhidden_values[]) = {"hide", "unload", "delete", "wipe", NULL}; |
20069
9a67d41708d2
patch 8.2.0590: no 'backspace' value allows ignoring the insertion point
Bram Moolenaar <Bram@vim.org>
parents:
19675
diff
changeset
|
76 static char *(p_bs_values[]) = {"indent", "eol", "start", "nostop", NULL}; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
77 #ifdef FEAT_FOLDING |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
78 static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax", |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
79 # ifdef FEAT_DIFF |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
80 "diff", |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
81 # endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
82 NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
83 static char *(p_fcl_values[]) = {"all", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
84 #endif |
18396
ba5d8c5d77d7
patch 8.1.2192: cannot easily fill the info popup asynchronously
Bram Moolenaar <Bram@vim.org>
parents:
18354
diff
changeset
|
85 static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "popuphidden", "noinsert", "noselect", NULL}; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
86 #ifdef BACKSLASH_IN_FILENAME |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
87 static char *(p_csl_values[]) = {"slash", "backslash", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
88 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
89 #ifdef FEAT_SIGNS |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
90 static char *(p_scl_values[]) = {"yes", "no", "auto", "number", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
91 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
92 #if defined(MSWIN) && defined(FEAT_TERMINAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
93 static char *(p_twt_values[]) = {"winpty", "conpty", "", NULL}; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
94 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
95 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
96 static int check_opt_strings(char_u *val, char **values, int list); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
97 static int opt_strings_flags(char_u *val, char **values, unsigned *flagp, int list); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
98 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
99 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
100 * After setting various option values: recompute variables that depend on |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
101 * option values. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
102 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
103 void |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
104 didset_string_options(void) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
105 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
106 (void)opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, TRUE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
107 (void)opt_strings_flags(p_bkc, p_bkc_values, &bkc_flags, TRUE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
108 (void)opt_strings_flags(p_bo, p_bo_values, &bo_flags, TRUE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
109 #ifdef FEAT_SESSION |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
110 (void)opt_strings_flags(p_ssop, p_ssop_values, &ssop_flags, TRUE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
111 (void)opt_strings_flags(p_vop, p_ssop_values, &vop_flags, TRUE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
112 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
113 #ifdef FEAT_FOLDING |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
114 (void)opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, TRUE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
115 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
116 (void)opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
117 (void)opt_strings_flags(p_tc, p_tc_values, &tc_flags, FALSE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
118 (void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE); |
18354
9f51d0cef8da
patch 8.1.2171: mouse support not always available
Bram Moolenaar <Bram@vim.org>
parents:
18303
diff
changeset
|
119 #if defined(UNIX) || defined(VMS) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
120 (void)opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
121 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
122 #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
123 (void)opt_strings_flags(p_toolbar, p_toolbar_values, &toolbar_flags, TRUE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
124 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
125 #if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
126 (void)opt_strings_flags(p_tbis, p_tbis_values, &tbis_flags, FALSE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
127 #endif |
28839
b93668df9160
patch 8.2.4943: changing 'switchbuf' may have no effect
Bram Moolenaar <Bram@vim.org>
parents:
28459
diff
changeset
|
128 (void)opt_strings_flags(p_swb, p_swb_values, &swb_flags, TRUE); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
129 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
130 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
131 #if defined(FEAT_EVAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
132 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
133 * Trigger the OptionSet autocommand. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
134 * "opt_idx" is the index of the option being set. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
135 * "opt_flags" can be OPT_LOCAL etc. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
136 * "oldval" the old value |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
137 * "oldval_l" the old local value (only non-NULL if global and local value |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
138 * are set) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
139 * "oldval_g" the old global value (only non-NULL if global and local value |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
140 * are set) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
141 * "newval" the new value |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
142 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
143 void |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
144 trigger_optionsset_string( |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
145 int opt_idx, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
146 int opt_flags, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
147 char_u *oldval, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
148 char_u *oldval_l, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
149 char_u *oldval_g, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
150 char_u *newval) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
151 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
152 // Don't do this recursively. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
153 if (oldval != NULL && newval != NULL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
154 && *get_vim_var_str(VV_OPTION_TYPE) == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
155 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
156 char_u buf_type[7]; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
157 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
158 sprintf((char *)buf_type, "%s", |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
159 (opt_flags & OPT_LOCAL) ? "local" : "global"); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
160 set_vim_var_string(VV_OPTION_OLD, oldval, -1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
161 set_vim_var_string(VV_OPTION_NEW, newval, -1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
162 set_vim_var_string(VV_OPTION_TYPE, buf_type, -1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
163 if (opt_flags & OPT_LOCAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
164 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
165 set_vim_var_string(VV_OPTION_COMMAND, (char_u *)"setlocal", -1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
166 set_vim_var_string(VV_OPTION_OLDLOCAL, oldval, -1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
167 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
168 if (opt_flags & OPT_GLOBAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
169 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
170 set_vim_var_string(VV_OPTION_COMMAND, (char_u *)"setglobal", -1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
171 set_vim_var_string(VV_OPTION_OLDGLOBAL, oldval, -1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
172 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
173 if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
174 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
175 set_vim_var_string(VV_OPTION_COMMAND, (char_u *)"set", -1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
176 set_vim_var_string(VV_OPTION_OLDLOCAL, oldval_l, -1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
177 set_vim_var_string(VV_OPTION_OLDGLOBAL, oldval_g, -1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
178 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
179 if (opt_flags & OPT_MODELINE) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
180 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
181 set_vim_var_string(VV_OPTION_COMMAND, (char_u *)"modeline", -1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
182 set_vim_var_string(VV_OPTION_OLDLOCAL, oldval, -1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
183 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
184 apply_autocmds(EVENT_OPTIONSET, |
27426
41e0dcf38521
patch 8.2.4241: some type casts are redundant
Bram Moolenaar <Bram@vim.org>
parents:
27330
diff
changeset
|
185 get_option_fullname(opt_idx), NULL, FALSE, |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
186 NULL); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
187 reset_v_option_vars(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
188 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
189 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
190 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
191 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
192 static char * |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
193 illegal_char(char *errbuf, int c) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
194 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
195 if (errbuf == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
196 return ""; |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
197 sprintf((char *)errbuf, _(e_illegal_character_str), (char *)transchar(c)); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
198 return errbuf; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
199 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
200 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
201 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
202 * Check string options in a buffer for NULL value. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
203 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
204 void |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
205 check_buf_options(buf_T *buf) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
206 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
207 check_string_option(&buf->b_p_bh); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
208 check_string_option(&buf->b_p_bt); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
209 check_string_option(&buf->b_p_fenc); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
210 check_string_option(&buf->b_p_ff); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
211 #ifdef FEAT_FIND_ID |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
212 check_string_option(&buf->b_p_def); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
213 check_string_option(&buf->b_p_inc); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
214 # ifdef FEAT_EVAL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
215 check_string_option(&buf->b_p_inex); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
216 # endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
217 #endif |
28942
6cdf55afaae9
patch 8.2.4993: smart/C/lisp indenting is optional
Bram Moolenaar <Bram@vim.org>
parents:
28839
diff
changeset
|
218 #if defined(FEAT_EVAL) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
219 check_string_option(&buf->b_p_inde); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
220 check_string_option(&buf->b_p_indk); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
221 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
222 #if defined(FEAT_BEVAL) && defined(FEAT_EVAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
223 check_string_option(&buf->b_p_bexpr); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
224 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
225 #if defined(FEAT_CRYPT) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
226 check_string_option(&buf->b_p_cm); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
227 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
228 check_string_option(&buf->b_p_fp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
229 #if defined(FEAT_EVAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
230 check_string_option(&buf->b_p_fex); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
231 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
232 #ifdef FEAT_CRYPT |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
233 check_string_option(&buf->b_p_key); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
234 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
235 check_string_option(&buf->b_p_kp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
236 check_string_option(&buf->b_p_mps); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
237 check_string_option(&buf->b_p_fo); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
238 check_string_option(&buf->b_p_flp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
239 check_string_option(&buf->b_p_isk); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
240 check_string_option(&buf->b_p_com); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
241 #ifdef FEAT_FOLDING |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
242 check_string_option(&buf->b_p_cms); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
243 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
244 check_string_option(&buf->b_p_nf); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
245 #ifdef FEAT_TEXTOBJ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
246 check_string_option(&buf->b_p_qe); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
247 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
248 #ifdef FEAT_SYN_HL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
249 check_string_option(&buf->b_p_syn); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
250 check_string_option(&buf->b_s.b_syn_isk); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
251 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
252 #ifdef FEAT_SPELL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
253 check_string_option(&buf->b_s.b_p_spc); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
254 check_string_option(&buf->b_s.b_p_spf); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
255 check_string_option(&buf->b_s.b_p_spl); |
20802
ed00f0fbdaef
patch 8.2.0953: spell checking doesn't work for CamelCased words
Bram Moolenaar <Bram@vim.org>
parents:
20760
diff
changeset
|
256 check_string_option(&buf->b_s.b_p_spo); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
257 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
258 #ifdef FEAT_SEARCHPATH |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
259 check_string_option(&buf->b_p_sua); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
260 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
261 check_string_option(&buf->b_p_cink); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
262 check_string_option(&buf->b_p_cino); |
28353
8bc8071928ed
patch 8.2.4702: C++ scope labels are hard-coded
Bram Moolenaar <Bram@vim.org>
parents:
28337
diff
changeset
|
263 check_string_option(&buf->b_p_cinsd); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
264 parse_cino(buf); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
265 check_string_option(&buf->b_p_ft); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
266 check_string_option(&buf->b_p_cinw); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
267 check_string_option(&buf->b_p_cpt); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
268 #ifdef FEAT_COMPL_FUNC |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
269 check_string_option(&buf->b_p_cfu); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
270 check_string_option(&buf->b_p_ofu); |
25984
c8fcea636252
patch 8.2.3525: option variable name does not match option name
Bram Moolenaar <Bram@vim.org>
parents:
25982
diff
changeset
|
271 check_string_option(&buf->b_p_tsrfu); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
272 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
273 #ifdef FEAT_EVAL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
274 check_string_option(&buf->b_p_tfu); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
275 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
276 #ifdef FEAT_KEYMAP |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
277 check_string_option(&buf->b_p_keymap); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
278 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
279 #ifdef FEAT_QUICKFIX |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
280 check_string_option(&buf->b_p_gp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
281 check_string_option(&buf->b_p_mp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
282 check_string_option(&buf->b_p_efm); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
283 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
284 check_string_option(&buf->b_p_ep); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
285 check_string_option(&buf->b_p_path); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
286 check_string_option(&buf->b_p_tags); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
287 check_string_option(&buf->b_p_tc); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
288 check_string_option(&buf->b_p_dict); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
289 check_string_option(&buf->b_p_tsr); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
290 check_string_option(&buf->b_p_lw); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
291 check_string_option(&buf->b_p_bkc); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
292 check_string_option(&buf->b_p_menc); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
293 #ifdef FEAT_VARTABS |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
294 check_string_option(&buf->b_p_vsts); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
295 check_string_option(&buf->b_p_vts); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
296 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
297 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
298 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
299 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
300 * Free the string allocated for an option. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
301 * Checks for the string being empty_option. This may happen if we're out of |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
302 * memory, vim_strsave() returned NULL, which was replaced by empty_option by |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
303 * check_options(). |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
304 * Does NOT check for P_ALLOCED flag! |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
305 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
306 void |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
307 free_string_option(char_u *p) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
308 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
309 if (p != empty_option) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
310 vim_free(p); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
311 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
312 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
313 void |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
314 clear_string_option(char_u **pp) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
315 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
316 if (*pp != empty_option) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
317 vim_free(*pp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
318 *pp = empty_option; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
319 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
320 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
321 void |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
322 check_string_option(char_u **pp) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
323 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
324 if (*pp == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
325 *pp = empty_option; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
326 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
327 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
328 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
329 * Set global value for string option when it's a local option. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
330 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
331 static void |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
332 set_string_option_global( |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
333 int opt_idx, // option index |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
334 char_u **varp) // pointer to option variable |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
335 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
336 char_u **p, *s; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
337 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
338 // the global value is always allocated |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
339 if (is_window_local_option(opt_idx)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
340 p = (char_u **)GLOBAL_WO(varp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
341 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
342 p = (char_u **)get_option_var(opt_idx); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
343 if (!is_global_option(opt_idx) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
344 && p != varp |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
345 && (s = vim_strsave(*varp)) != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
346 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
347 free_string_option(*p); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
348 *p = s; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
349 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
350 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
351 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
352 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
353 * Set a string option to a new value (without checking the effect). |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
354 * The string is copied into allocated memory. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
355 * if ("opt_idx" == -1) "name" is used, otherwise "opt_idx" is used. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
356 * When "set_sid" is zero set the scriptID to current_sctx.sc_sid. When |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
357 * "set_sid" is SID_NONE don't set the scriptID. Otherwise set the scriptID to |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
358 * "set_sid". |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
359 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
360 void |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
361 set_string_option_direct( |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
362 char_u *name, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
363 int opt_idx, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
364 char_u *val, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
365 int opt_flags, // OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
366 int set_sid UNUSED) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
367 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
368 char_u *s; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
369 char_u **varp; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
370 int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
371 int idx = opt_idx; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
372 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
373 if (idx == -1) // use name |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
374 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
375 idx = findoption(name); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
376 if (idx < 0) // not found (should not happen) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
377 { |
26877
06a137af96f8
patch 8.2.3967: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26865
diff
changeset
|
378 semsg(_(e_internal_error_str), "set_string_option_direct()"); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
379 siemsg(_("For option %s"), name); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
380 return; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
381 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
382 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
383 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
384 if (is_hidden_option(idx)) // can't set hidden option |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
385 return; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
386 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
387 s = vim_strsave(val); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
388 if (s != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
389 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
390 varp = (char_u **)get_option_varp_scope(idx, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
391 both ? OPT_LOCAL : opt_flags); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
392 if ((opt_flags & OPT_FREE) && (get_option_flags(idx) & P_ALLOCED)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
393 free_string_option(*varp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
394 *varp = s; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
395 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
396 // For buffer/window local option may also set the global value. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
397 if (both) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
398 set_string_option_global(idx, varp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
399 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
400 set_option_flag(idx, P_ALLOCED); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
401 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
402 // When setting both values of a global option with a local value, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
403 // make the local value empty, so that the global value is used. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
404 if (is_global_local_option(idx) && both) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
405 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
406 free_string_option(*varp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
407 *varp = empty_option; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
408 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
409 # ifdef FEAT_EVAL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
410 if (set_sid != SID_NONE) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
411 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
412 sctx_T script_ctx; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
413 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
414 if (set_sid == 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
415 script_ctx = current_sctx; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
416 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
417 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
418 script_ctx.sc_sid = set_sid; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
419 script_ctx.sc_seq = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
420 script_ctx.sc_lnum = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
421 script_ctx.sc_version = 1; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
422 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
423 set_option_sctx_idx(idx, opt_flags, script_ctx); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
424 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
425 # endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
426 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
427 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
428 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
429 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
430 * Like set_string_option_direct(), but for a window-local option in "wp". |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
431 * Blocks autocommands to avoid the old curwin becoming invalid. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
432 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
433 void |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
434 set_string_option_direct_in_win( |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
435 win_T *wp, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
436 char_u *name, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
437 int opt_idx, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
438 char_u *val, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
439 int opt_flags, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
440 int set_sid) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
441 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
442 win_T *save_curwin = curwin; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
443 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
444 block_autocmds(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
445 curwin = wp; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
446 curbuf = curwin->w_buffer; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
447 set_string_option_direct(name, opt_idx, val, opt_flags, set_sid); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
448 curwin = save_curwin; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
449 curbuf = curwin->w_buffer; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
450 unblock_autocmds(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
451 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
452 |
27018
268f6a3511df
patch 8.2.4038: various code not used when features are disabled
Bram Moolenaar <Bram@vim.org>
parents:
27000
diff
changeset
|
453 #if defined(FEAT_PROP_POPUP) || defined(PROTO) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
454 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
455 * Like set_string_option_direct(), but for a buffer-local option in "buf". |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
456 * Blocks autocommands to avoid the old curbuf becoming invalid. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
457 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
458 void |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
459 set_string_option_direct_in_buf( |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
460 buf_T *buf, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
461 char_u *name, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
462 int opt_idx, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
463 char_u *val, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
464 int opt_flags, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
465 int set_sid) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
466 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
467 buf_T *save_curbuf = curbuf; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
468 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
469 block_autocmds(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
470 curbuf = buf; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
471 curwin->w_buffer = curbuf; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
472 set_string_option_direct(name, opt_idx, val, opt_flags, set_sid); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
473 curbuf = save_curbuf; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
474 curwin->w_buffer = curbuf; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
475 unblock_autocmds(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
476 } |
27018
268f6a3511df
patch 8.2.4038: various code not used when features are disabled
Bram Moolenaar <Bram@vim.org>
parents:
27000
diff
changeset
|
477 #endif |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
478 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
479 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
480 * Set a string option to a new value, and handle the effects. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
481 * |
28457
4dcccb2673fe
patch 8.2.4753: error from setting an option is silently ignored
Bram Moolenaar <Bram@vim.org>
parents:
28455
diff
changeset
|
482 * Returns NULL on success or an untranslated error message on error. |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
483 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
484 char * |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
485 set_string_option( |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
486 int opt_idx, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
487 char_u *value, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
488 int opt_flags) // OPT_LOCAL and/or OPT_GLOBAL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
489 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
490 char_u *s; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
491 char_u **varp; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
492 char_u *oldval; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
493 #if defined(FEAT_EVAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
494 char_u *oldval_l = NULL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
495 char_u *oldval_g = NULL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
496 char_u *saved_oldval = NULL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
497 char_u *saved_oldval_l = NULL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
498 char_u *saved_oldval_g = NULL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
499 char_u *saved_newval = NULL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
500 #endif |
28457
4dcccb2673fe
patch 8.2.4753: error from setting an option is silently ignored
Bram Moolenaar <Bram@vim.org>
parents:
28455
diff
changeset
|
501 char *errmsg = NULL; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
502 int value_checked = FALSE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
503 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
504 if (is_hidden_option(opt_idx)) // don't set hidden option |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
505 return NULL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
506 |
19675
bee179e81f28
patch 8.2.0394: Coverity complains about using NULL pointer
Bram Moolenaar <Bram@vim.org>
parents:
19265
diff
changeset
|
507 s = vim_strsave(value == NULL ? (char_u *)"" : value); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
508 if (s != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
509 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
510 varp = (char_u **)get_option_varp_scope(opt_idx, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
511 (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
512 ? (is_global_local_option(opt_idx) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
513 ? OPT_GLOBAL : OPT_LOCAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
514 : opt_flags); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
515 oldval = *varp; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
516 #if defined(FEAT_EVAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
517 if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
518 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
519 oldval_l = *(char_u **)get_option_varp_scope(opt_idx, OPT_LOCAL); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
520 oldval_g = *(char_u **)get_option_varp_scope(opt_idx, OPT_GLOBAL); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
521 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
522 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
523 *varp = s; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
524 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
525 #if defined(FEAT_EVAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
526 if (!starting |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
527 # ifdef FEAT_CRYPT |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
528 && !is_crypt_key_option(opt_idx) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
529 # endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
530 ) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
531 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
532 if (oldval_l != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
533 saved_oldval_l = vim_strsave(oldval_l); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
534 if (oldval_g != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
535 saved_oldval_g = vim_strsave(oldval_g); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
536 saved_oldval = vim_strsave(oldval); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
537 saved_newval = vim_strsave(s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
538 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
539 #endif |
29509
d61007cc39b3
patch 9.0.0096: flag "new_value_alloced" is always true
Bram Moolenaar <Bram@vim.org>
parents:
29395
diff
changeset
|
540 if ((errmsg = did_set_string_option(opt_idx, varp, oldval, NULL, |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
541 opt_flags, &value_checked)) == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
542 did_set_option(opt_idx, opt_flags, TRUE, value_checked); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
543 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
544 #if defined(FEAT_EVAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
545 // call autocommand after handling side effects |
28457
4dcccb2673fe
patch 8.2.4753: error from setting an option is silently ignored
Bram Moolenaar <Bram@vim.org>
parents:
28455
diff
changeset
|
546 if (errmsg == NULL) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
547 trigger_optionsset_string(opt_idx, opt_flags, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
548 saved_oldval, saved_oldval_l, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
549 saved_oldval_g, saved_newval); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
550 vim_free(saved_oldval); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
551 vim_free(saved_oldval_l); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
552 vim_free(saved_oldval_g); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
553 vim_free(saved_newval); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
554 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
555 } |
28457
4dcccb2673fe
patch 8.2.4753: error from setting an option is silently ignored
Bram Moolenaar <Bram@vim.org>
parents:
28455
diff
changeset
|
556 return errmsg; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
557 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
558 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
559 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
560 * Return TRUE if "val" is a valid 'filetype' name. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
561 * Also used for 'syntax' and 'keymap'. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
562 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
563 static int |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
564 valid_filetype(char_u *val) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
565 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
566 return valid_name(val, ".-_"); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
567 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
568 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
569 #ifdef FEAT_STL_OPT |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
570 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
571 * Check validity of options with the 'statusline' format. |
28455
8f4f16efeeb3
patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents:
28451
diff
changeset
|
572 * Return an untranslated error message or NULL. |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
573 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
574 static char * |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
575 check_stl_option(char_u *s) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
576 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
577 int groupdepth = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
578 static char errbuf[80]; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
579 |
22721
92a100fc5e17
patch 8.2.1909: number of status line items is limited to 80
Bram Moolenaar <Bram@vim.org>
parents:
22091
diff
changeset
|
580 while (*s) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
581 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
582 // Check for valid keys after % sequences |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
583 while (*s && *s != '%') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
584 s++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
585 if (!*s) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
586 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
587 s++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
588 if (*s == '%' || *s == STL_TRUNCMARK || *s == STL_MIDDLEMARK) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
589 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
590 s++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
591 continue; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
592 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
593 if (*s == ')') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
594 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
595 s++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
596 if (--groupdepth < 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
597 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
598 continue; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
599 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
600 if (*s == '-') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
601 s++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
602 while (VIM_ISDIGIT(*s)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
603 s++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
604 if (*s == STL_USER_HL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
605 continue; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
606 if (*s == '.') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
607 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
608 s++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
609 while (*s && VIM_ISDIGIT(*s)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
610 s++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
611 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
612 if (*s == '(') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
613 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
614 groupdepth++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
615 continue; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
616 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
617 if (vim_strchr(STL_ALL, *s) == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
618 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
619 return illegal_char(errbuf, *s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
620 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
621 if (*s == '{') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
622 { |
28455
8f4f16efeeb3
patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents:
28451
diff
changeset
|
623 int reevaluate = (*++s == '%'); |
24630
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24582
diff
changeset
|
624 |
28455
8f4f16efeeb3
patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents:
28451
diff
changeset
|
625 if (reevaluate && *++s == '}') |
8f4f16efeeb3
patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents:
28451
diff
changeset
|
626 // "}" is not allowed immediately after "%{%" |
8f4f16efeeb3
patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents:
28451
diff
changeset
|
627 return illegal_char(errbuf, '}'); |
24630
4cf4d7a71fac
patch 8.2.2854: custom statusline cannot contain % items
Bram Moolenaar <Bram@vim.org>
parents:
24582
diff
changeset
|
628 while ((*s != '}' || (reevaluate && s[-1] != '%')) && *s) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
629 s++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
630 if (*s != '}') |
28455
8f4f16efeeb3
patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents:
28451
diff
changeset
|
631 return e_unclosed_expression_sequence; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
632 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
633 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
634 if (groupdepth != 0) |
28455
8f4f16efeeb3
patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents:
28451
diff
changeset
|
635 return e_unbalanced_groups; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
636 return NULL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
637 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
638 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
639 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
640 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
641 * Handle string options that need some action to perform when changed. |
29509
d61007cc39b3
patch 9.0.0096: flag "new_value_alloced" is always true
Bram Moolenaar <Bram@vim.org>
parents:
29395
diff
changeset
|
642 * The new value must be allocated. |
28459
52ef65c0637f
patch 8.2.4754: using cached values after unsetting some environment variables
Bram Moolenaar <Bram@vim.org>
parents:
28457
diff
changeset
|
643 * Returns NULL for success, or an unstranslated error message for an error. |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
644 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
645 char * |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
646 did_set_string_option( |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
647 int opt_idx, // index in options[] table |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
648 char_u **varp, // pointer to the option variable |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
649 char_u *oldval, // previous value of the option |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
650 char *errbuf, // buffer for errors, or NULL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
651 int opt_flags, // OPT_LOCAL and/or OPT_GLOBAL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
652 int *value_checked) // value was checked to be save, no |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
653 // need to set P_INSECURE |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
654 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
655 char *errmsg = NULL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
656 char_u *s, *p; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
657 int did_chartab = FALSE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
658 char_u **gvarp; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
659 long_u free_oldval = (get_option_flags(opt_idx) & P_ALLOCED); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
660 #ifdef FEAT_GUI |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
661 // set when changing an option that only requires a redraw in the GUI |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
662 int redraw_gui_only = FALSE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
663 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
664 int value_changed = FALSE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
665 #if defined(FEAT_VTP) && defined(FEAT_TERMGUICOLORS) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
666 int did_swaptcap = FALSE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
667 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
668 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
669 // Get the global option to compare with, otherwise we would have to check |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
670 // two values for all local options. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
671 gvarp = (char_u **)get_option_varp_scope(opt_idx, OPT_GLOBAL); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
672 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
673 // Disallow changing some options from secure mode |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
674 if ((secure |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
675 #ifdef HAVE_SANDBOX |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
676 || sandbox != 0 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
677 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
678 ) && (get_option_flags(opt_idx) & P_SECURE)) |
26883
7f150a4936f2
patch 8.2.3970: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26877
diff
changeset
|
679 errmsg = e_not_allowed_here; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
680 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
681 // Check for a "normal" directory or file name in some options. Disallow a |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
682 // path separator (slash and/or backslash), wildcards and characters that |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
683 // are often illegal in a file name. Be more permissive if "secure" is off. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
684 else if (((get_option_flags(opt_idx) & P_NFNAME) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
685 && vim_strpbrk(*varp, (char_u *)(secure |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
686 ? "/\\*?[|;&<>\r\n" : "/\\*?[<>\r\n")) != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
687 || ((get_option_flags(opt_idx) & P_NDNAME) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
688 && vim_strpbrk(*varp, (char_u *)"*?[|;&<>\r\n") != NULL)) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
689 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
690 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
691 // 'term' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
692 else if (varp == &T_NAME) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
693 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
694 if (T_NAME[0] == NUL) |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
695 errmsg = e_cannot_set_term_to_empty_string; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
696 #ifdef FEAT_GUI |
23810
8152b7daebad
patch 8.2.2446: setting 'term' empty has different error if compiled with GUI
Bram Moolenaar <Bram@vim.org>
parents:
22721
diff
changeset
|
697 else if (gui.in_use) |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
698 errmsg = e_cannot_change_term_in_GUI; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
699 else if (term_is_gui(T_NAME)) |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
700 errmsg = e_use_gui_to_start_GUI; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
701 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
702 else if (set_termname(T_NAME) == FAIL) |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
703 errmsg = e_not_found_in_termcap; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
704 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
705 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
706 // Screen colors may have changed. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
707 redraw_later_clear(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
708 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
709 // Both 'term' and 'ttytype' point to T_NAME, only set the |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
710 // P_ALLOCED flag on 'term'. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
711 opt_idx = findoption((char_u *)"term"); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
712 free_oldval = (get_option_flags(opt_idx) & P_ALLOCED); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
713 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
714 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
715 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
716 // 'backupcopy' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
717 else if (gvarp == &p_bkc) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
718 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
719 char_u *bkc = p_bkc; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
720 unsigned int *flags = &bkc_flags; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
721 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
722 if (opt_flags & OPT_LOCAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
723 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
724 bkc = curbuf->b_p_bkc; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
725 flags = &curbuf->b_bkc_flags; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
726 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
727 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
728 if ((opt_flags & OPT_LOCAL) && *bkc == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
729 // make the local value empty: use the global value |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
730 *flags = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
731 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
732 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
733 if (opt_strings_flags(bkc, p_bkc_values, flags, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
734 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
735 if ((((int)*flags & BKC_AUTO) != 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
736 + (((int)*flags & BKC_YES) != 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
737 + (((int)*flags & BKC_NO) != 0) != 1) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
738 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
739 // Must have exactly one of "auto", "yes" and "no". |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
740 (void)opt_strings_flags(oldval, p_bkc_values, flags, TRUE); |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
741 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
742 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
743 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
744 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
745 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
746 // 'backupext' and 'patchmode' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
747 else if (varp == &p_bex || varp == &p_pm) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
748 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
749 if (STRCMP(*p_bex == '.' ? p_bex + 1 : p_bex, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
750 *p_pm == '.' ? p_pm + 1 : p_pm) == 0) |
28457
4dcccb2673fe
patch 8.2.4753: error from setting an option is silently ignored
Bram Moolenaar <Bram@vim.org>
parents:
28455
diff
changeset
|
751 errmsg = e_backupext_and_patchmode_are_equal; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
752 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
753 #ifdef FEAT_LINEBREAK |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
754 // 'breakindentopt' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
755 else if (varp == &curwin->w_p_briopt) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
756 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
757 if (briopt_check(curwin) == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
758 errmsg = e_invalid_argument; |
27000
8c0730eca2ce
patch 8.2.4029: debugging NFA regexp my crash, cached indent may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
26966
diff
changeset
|
759 // list setting requires a redraw |
8c0730eca2ce
patch 8.2.4029: debugging NFA regexp my crash, cached indent may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
26966
diff
changeset
|
760 if (curwin->w_briopt_list) |
8c0730eca2ce
patch 8.2.4029: debugging NFA regexp my crash, cached indent may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
26966
diff
changeset
|
761 redraw_all_later(NOT_VALID); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
762 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
763 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
764 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
765 // 'isident', 'iskeyword', 'isprint or 'isfname' option: refill g_chartab[] |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
766 // If the new option is invalid, use old value. 'lisp' option: refill |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
767 // g_chartab[] for '-' char |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
768 else if ( varp == &p_isi |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
769 || varp == &(curbuf->b_p_isk) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
770 || varp == &p_isp |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
771 || varp == &p_isf) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
772 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
773 if (init_chartab() == FAIL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
774 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
775 did_chartab = TRUE; // need to restore it below |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
776 errmsg = e_invalid_argument; // error in value |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
777 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
778 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
779 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
780 // 'helpfile' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
781 else if (varp == &p_hf) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
782 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
783 // May compute new values for $VIM and $VIMRUNTIME |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
784 if (didset_vim) |
28459
52ef65c0637f
patch 8.2.4754: using cached values after unsetting some environment variables
Bram Moolenaar <Bram@vim.org>
parents:
28457
diff
changeset
|
785 vim_unsetenv_ext((char_u *)"VIM"); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
786 if (didset_vimruntime) |
28459
52ef65c0637f
patch 8.2.4754: using cached values after unsetting some environment variables
Bram Moolenaar <Bram@vim.org>
parents:
28457
diff
changeset
|
787 vim_unsetenv_ext((char_u *)"VIMRUNTIME"); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
788 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
789 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
790 #ifdef FEAT_SYN_HL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
791 // 'cursorlineopt' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
792 else if (varp == &curwin->w_p_culopt |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
793 || gvarp == &curwin->w_allbuf_opt.wo_culopt) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
794 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
795 if (**varp == NUL || fill_culopt_flags(*varp, curwin) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
796 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
797 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
798 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
799 // 'colorcolumn' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
800 else if (varp == &curwin->w_p_cc) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
801 errmsg = check_colorcolumn(curwin); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
802 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
803 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
804 #ifdef FEAT_MULTI_LANG |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
805 // 'helplang' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
806 else if (varp == &p_hlg) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
807 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
808 // Check for "", "ab", "ab,cd", etc. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
809 for (s = p_hlg; *s != NUL; s += 3) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
810 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
811 if (s[1] == NUL || ((s[2] != ',' || s[3] == NUL) && s[2] != NUL)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
812 { |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
813 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
814 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
815 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
816 if (s[2] == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
817 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
818 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
819 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
820 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
821 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
822 // 'highlight' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
823 else if (varp == &p_hl) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
824 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
825 if (highlight_changed() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
826 errmsg = e_invalid_argument; // invalid flags |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
827 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
828 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
829 // 'nrformats' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
830 else if (gvarp == &p_nf) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
831 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
832 if (check_opt_strings(*varp, p_nf_values, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
833 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
834 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
835 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
836 #ifdef FEAT_SESSION |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
837 // 'sessionoptions' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
838 else if (varp == &p_ssop) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
839 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
840 if (opt_strings_flags(p_ssop, p_ssop_values, &ssop_flags, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
841 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
842 if ((ssop_flags & SSOP_CURDIR) && (ssop_flags & SSOP_SESDIR)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
843 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
844 // Don't allow both "sesdir" and "curdir". |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
845 (void)opt_strings_flags(oldval, p_ssop_values, &ssop_flags, TRUE); |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
846 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
847 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
848 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
849 // 'viewoptions' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
850 else if (varp == &p_vop) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
851 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
852 if (opt_strings_flags(p_vop, p_ssop_values, &vop_flags, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
853 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
854 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
855 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
856 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
857 // 'scrollopt' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
858 else if (varp == &p_sbo) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
859 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
860 if (check_opt_strings(p_sbo, p_scbopt_values, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
861 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
862 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
863 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
864 // 'ambiwidth' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
865 else if (varp == &p_ambw || varp == &p_emoji) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
866 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
867 if (check_opt_strings(p_ambw, p_ambw_values, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
868 errmsg = e_invalid_argument; |
29395
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
869 else if (set_chars_option(curwin, &p_fcs, FALSE) != NULL) |
28457
4dcccb2673fe
patch 8.2.4753: error from setting an option is silently ignored
Bram Moolenaar <Bram@vim.org>
parents:
28455
diff
changeset
|
870 errmsg = e_conflicts_with_value_of_fillchars; |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
871 else |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
872 { |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
873 tabpage_T *tp; |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
874 win_T *wp; |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
875 |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
876 FOR_ALL_TAB_WINDOWS(tp, wp) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
877 { |
29395
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
878 if (set_chars_option(wp, &wp->w_p_lcs, FALSE) != NULL) |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
879 { |
28457
4dcccb2673fe
patch 8.2.4753: error from setting an option is silently ignored
Bram Moolenaar <Bram@vim.org>
parents:
28455
diff
changeset
|
880 errmsg = e_conflicts_with_value_of_listchars; |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
881 goto ambw_end; |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
882 } |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
883 } |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
884 } |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
885 ambw_end: |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
886 {} |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
887 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
888 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
889 // 'background' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
890 else if (varp == &p_bg) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
891 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
892 if (check_opt_strings(p_bg, p_bg_values, FALSE) == OK) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
893 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
894 #ifdef FEAT_EVAL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
895 int dark = (*p_bg == 'd'); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
896 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
897 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
898 init_highlight(FALSE, FALSE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
899 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
900 #ifdef FEAT_EVAL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
901 if (dark != (*p_bg == 'd') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
902 && get_var_value((char_u *)"g:colors_name") != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
903 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
904 // The color scheme must have set 'background' back to another |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
905 // value, that's not what we want here. Disable the color |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
906 // scheme and set the colors again. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
907 do_unlet((char_u *)"g:colors_name", TRUE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
908 free_string_option(p_bg); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
909 p_bg = vim_strsave((char_u *)(dark ? "dark" : "light")); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
910 check_string_option(&p_bg); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
911 init_highlight(FALSE, FALSE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
912 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
913 #endif |
24582
1a658c5eb326
patch 8.2.2830: terminal colors are not updated when 'background' is set
Bram Moolenaar <Bram@vim.org>
parents:
24464
diff
changeset
|
914 #ifdef FEAT_TERMINAL |
1a658c5eb326
patch 8.2.2830: terminal colors are not updated when 'background' is set
Bram Moolenaar <Bram@vim.org>
parents:
24464
diff
changeset
|
915 term_update_colors_all(); |
1a658c5eb326
patch 8.2.2830: terminal colors are not updated when 'background' is set
Bram Moolenaar <Bram@vim.org>
parents:
24464
diff
changeset
|
916 #endif |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
917 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
918 else |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
919 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
920 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
921 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
922 // 'wildmode' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
923 else if (varp == &p_wim) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
924 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
925 if (check_opt_wim() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
926 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
927 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
928 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
929 // 'wildoptions' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
930 else if (varp == &p_wop) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
931 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
932 if (check_opt_strings(p_wop, p_wop_values, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
933 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
934 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
935 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
936 #ifdef FEAT_WAK |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
937 // 'winaltkeys' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
938 else if (varp == &p_wak) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
939 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
940 if (*p_wak == NUL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
941 || check_opt_strings(p_wak, p_wak_values, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
942 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
943 # ifdef FEAT_MENU |
28337
1cd053ebb5fc
patch 8.2.4694: avoidance of #elif causes more preproc nesting
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
944 # if defined(FEAT_GUI_MOTIF) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
945 else if (gui.in_use) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
946 gui_motif_set_mnemonics(p_wak[0] == 'y' || p_wak[0] == 'm'); |
28337
1cd053ebb5fc
patch 8.2.4694: avoidance of #elif causes more preproc nesting
Bram Moolenaar <Bram@vim.org>
parents:
27875
diff
changeset
|
947 # elif defined(FEAT_GUI_GTK) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
948 else if (gui.in_use) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
949 gui_gtk_set_mnemonics(p_wak[0] == 'y' || p_wak[0] == 'm'); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
950 # endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
951 # endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
952 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
953 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
954 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
955 // 'eventignore' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
956 else if (varp == &p_ei) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
957 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
958 if (check_ei() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
959 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
960 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
961 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
962 // 'encoding', 'fileencoding', 'termencoding' and 'makeencoding' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
963 else if (varp == &p_enc || gvarp == &p_fenc || varp == &p_tenc |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
964 || gvarp == &p_menc) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
965 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
966 if (gvarp == &p_fenc) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
967 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
968 if (!curbuf->b_p_ma && opt_flags != OPT_GLOBAL) |
25064
8f2262c72178
patch 8.2.3069: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
24970
diff
changeset
|
969 errmsg = e_cannot_make_changes_modifiable_is_off; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
970 else if (vim_strchr(*varp, ',') != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
971 // No comma allowed in 'fileencoding'; catches confusing it |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
972 // with 'fileencodings'. |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
973 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
974 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
975 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
976 // May show a "+" in the title now. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
977 redraw_titles(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
978 // Add 'fileencoding' to the swap file. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
979 ml_setflags(curbuf); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
980 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
981 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
982 if (errmsg == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
983 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
984 // canonize the value, so that STRCMP() can be used on it |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
985 p = enc_canonize(*varp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
986 if (p != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
987 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
988 vim_free(*varp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
989 *varp = p; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
990 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
991 if (varp == &p_enc) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
992 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
993 errmsg = mb_init(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
994 redraw_titles(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
995 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
996 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
997 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
998 #if defined(FEAT_GUI_GTK) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
999 if (errmsg == NULL && varp == &p_tenc && gui.in_use) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1000 { |
26948
51ddf6740ac6
patch 8.2.4003: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26917
diff
changeset
|
1001 // GTK uses only a single encoding, and that is UTF-8. |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1002 if (STRCMP(p_tenc, "utf-8") != 0) |
26948
51ddf6740ac6
patch 8.2.4003: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26917
diff
changeset
|
1003 errmsg = e_cannot_be_changed_in_gtk_GUI; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1004 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1005 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1006 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1007 if (errmsg == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1008 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1009 #ifdef FEAT_KEYMAP |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1010 // When 'keymap' is used and 'encoding' changes, reload the keymap |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1011 // (with another encoding). |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1012 if (varp == &p_enc && *curbuf->b_p_keymap != NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1013 (void)keymap_init(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1014 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1015 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1016 // When 'termencoding' is not empty and 'encoding' changes or when |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1017 // 'termencoding' changes, need to setup for keyboard input and |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1018 // display output conversion. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1019 if (((varp == &p_enc && *p_tenc != NUL) || varp == &p_tenc)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1020 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1021 if (convert_setup(&input_conv, p_tenc, p_enc) == FAIL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1022 || convert_setup(&output_conv, p_enc, p_tenc) == FAIL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1023 { |
26966
ac75c145f0a9
patch 8.2.4012: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26948
diff
changeset
|
1024 semsg(_(e_cannot_convert_between_str_and_str), |
ac75c145f0a9
patch 8.2.4012: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26948
diff
changeset
|
1025 p_tenc, p_enc); |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1026 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1027 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1028 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1029 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1030 #if defined(MSWIN) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1031 // $HOME may have characters in active code page. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1032 if (varp == &p_enc) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1033 init_homedir(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1034 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1035 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1036 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1037 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1038 #if defined(FEAT_POSTSCRIPT) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1039 else if (varp == &p_penc) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1040 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1041 // Canonize printencoding if VIM standard one |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1042 p = enc_canonize(p_penc); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1043 if (p != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1044 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1045 vim_free(p_penc); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1046 p_penc = p; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1047 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1048 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1049 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1050 // Ensure lower case and '-' for '_' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1051 for (s = p_penc; *s != NUL; s++) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1052 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1053 if (*s == '_') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1054 *s = '-'; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1055 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1056 *s = TOLOWER_ASC(*s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1057 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1058 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1059 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1060 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1061 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1062 #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1063 else if (varp == &p_imak) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1064 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1065 if (!im_xim_isvalid_imactivate()) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1066 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1067 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1068 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1069 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1070 #ifdef FEAT_KEYMAP |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1071 else if (varp == &curbuf->b_p_keymap) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1072 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1073 if (!valid_filetype(*varp)) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1074 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1075 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1076 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1077 int secure_save = secure; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1078 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1079 // Reset the secure flag, since the value of 'keymap' has |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1080 // been checked to be safe. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1081 secure = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1082 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1083 // load or unload key mapping tables |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1084 errmsg = keymap_init(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1085 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1086 secure = secure_save; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1087 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1088 // Since we check the value, there is no need to set P_INSECURE, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1089 // even when the value comes from a modeline. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1090 *value_checked = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1091 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1092 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1093 if (errmsg == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1094 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1095 if (*curbuf->b_p_keymap != NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1096 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1097 // Installed a new keymap, switch on using it. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1098 curbuf->b_p_iminsert = B_IMODE_LMAP; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1099 if (curbuf->b_p_imsearch != B_IMODE_USE_INSERT) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1100 curbuf->b_p_imsearch = B_IMODE_LMAP; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1101 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1102 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1103 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1104 // Cleared the keymap, may reset 'iminsert' and 'imsearch'. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1105 if (curbuf->b_p_iminsert == B_IMODE_LMAP) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1106 curbuf->b_p_iminsert = B_IMODE_NONE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1107 if (curbuf->b_p_imsearch == B_IMODE_LMAP) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1108 curbuf->b_p_imsearch = B_IMODE_USE_INSERT; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1109 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1110 if ((opt_flags & OPT_LOCAL) == 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1111 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1112 set_iminsert_global(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1113 set_imsearch_global(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1114 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1115 status_redraw_curbuf(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1116 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1117 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1118 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1119 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1120 // 'fileformat' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1121 else if (gvarp == &p_ff) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1122 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1123 if (!curbuf->b_p_ma && !(opt_flags & OPT_GLOBAL)) |
25064
8f2262c72178
patch 8.2.3069: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
24970
diff
changeset
|
1124 errmsg = e_cannot_make_changes_modifiable_is_off; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1125 else if (check_opt_strings(*varp, p_ff_values, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1126 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1127 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1128 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1129 // may also change 'textmode' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1130 if (get_fileformat(curbuf) == EOL_DOS) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1131 curbuf->b_p_tx = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1132 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1133 curbuf->b_p_tx = FALSE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1134 redraw_titles(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1135 // update flag in swap file |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1136 ml_setflags(curbuf); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1137 // Redraw needed when switching to/from "mac": a CR in the text |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1138 // will be displayed differently. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1139 if (get_fileformat(curbuf) == EOL_MAC || *oldval == 'm') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1140 redraw_curbuf_later(NOT_VALID); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1141 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1142 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1143 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1144 // 'fileformats' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1145 else if (varp == &p_ffs) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1146 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1147 if (check_opt_strings(p_ffs, p_ff_values, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1148 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1149 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1150 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1151 // also change 'textauto' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1152 if (*p_ffs == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1153 p_ta = FALSE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1154 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1155 p_ta = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1156 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1157 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1158 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1159 #if defined(FEAT_CRYPT) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1160 // 'cryptkey' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1161 else if (gvarp == &p_key) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1162 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1163 // Make sure the ":set" command doesn't show the new value in the |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1164 // history. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1165 remove_key_from_history(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1166 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1167 if (STRCMP(curbuf->b_p_key, oldval) != 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1168 // Need to update the swapfile. |
20415
b582eb6ef192
patch 8.2.0762: buffer is not considered modified after setting crypt key
Bram Moolenaar <Bram@vim.org>
parents:
20069
diff
changeset
|
1169 { |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1170 ml_set_crypt_key(curbuf, oldval, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1171 *curbuf->b_p_cm == NUL ? p_cm : curbuf->b_p_cm); |
20415
b582eb6ef192
patch 8.2.0762: buffer is not considered modified after setting crypt key
Bram Moolenaar <Bram@vim.org>
parents:
20069
diff
changeset
|
1172 changed_internal(); |
b582eb6ef192
patch 8.2.0762: buffer is not considered modified after setting crypt key
Bram Moolenaar <Bram@vim.org>
parents:
20069
diff
changeset
|
1173 } |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1174 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1175 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1176 else if (gvarp == &p_cm) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1177 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1178 if (opt_flags & OPT_LOCAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1179 p = curbuf->b_p_cm; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1180 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1181 p = p_cm; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1182 if (check_opt_strings(p, p_cm_values, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1183 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1184 else if (crypt_self_test() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1185 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1186 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1187 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1188 // When setting the global value to empty, make it "zip". |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1189 if (*p_cm == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1190 { |
29509
d61007cc39b3
patch 9.0.0096: flag "new_value_alloced" is always true
Bram Moolenaar <Bram@vim.org>
parents:
29395
diff
changeset
|
1191 free_string_option(p_cm); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1192 p_cm = vim_strsave((char_u *)"zip"); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1193 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1194 // When using ":set cm=name" the local value is going to be empty. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1195 // Do that here, otherwise the crypt functions will still use the |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1196 // local value. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1197 if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1198 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1199 free_string_option(curbuf->b_p_cm); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1200 curbuf->b_p_cm = empty_option; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1201 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1202 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1203 // Need to update the swapfile when the effective method changed. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1204 // Set "s" to the effective old value, "p" to the effective new |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1205 // method and compare. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1206 if ((opt_flags & OPT_LOCAL) && *oldval == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1207 s = p_cm; // was previously using the global value |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1208 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1209 s = oldval; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1210 if (*curbuf->b_p_cm == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1211 p = p_cm; // is now using the global value |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1212 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1213 p = curbuf->b_p_cm; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1214 if (STRCMP(s, p) != 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1215 ml_set_crypt_key(curbuf, curbuf->b_p_key, s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1216 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1217 // If the global value changes need to update the swapfile for all |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1218 // buffers using that value. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1219 if ((opt_flags & OPT_GLOBAL) && STRCMP(p_cm, oldval) != 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1220 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1221 buf_T *buf; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1222 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1223 FOR_ALL_BUFFERS(buf) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1224 if (buf != curbuf && *buf->b_p_cm == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1225 ml_set_crypt_key(buf, buf->b_p_key, oldval); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1226 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1227 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1228 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1229 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1230 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1231 // 'matchpairs' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1232 else if (gvarp == &p_mps) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1233 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1234 if (has_mbyte) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1235 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1236 for (p = *varp; *p != NUL; ++p) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1237 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1238 int x2 = -1; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1239 int x3 = -1; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1240 |
28451
e015d650ea9f
patch 8.2.4750: small pieces of dead code
Bram Moolenaar <Bram@vim.org>
parents:
28439
diff
changeset
|
1241 p += mb_ptr2len(p); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1242 if (*p != NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1243 x2 = *p++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1244 if (*p != NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1245 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1246 x3 = mb_ptr2char(p); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1247 p += mb_ptr2len(p); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1248 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1249 if (x2 != ':' || x3 == -1 || (*p != NUL && *p != ',')) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1250 { |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1251 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1252 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1253 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1254 if (*p == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1255 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1256 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1257 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1258 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1259 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1260 // Check for "x:y,x:y" |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1261 for (p = *varp; *p != NUL; p += 4) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1262 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1263 if (p[1] != ':' || p[2] == NUL || (p[3] != NUL && p[3] != ',')) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1264 { |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1265 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1266 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1267 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1268 if (p[3] == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1269 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1270 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1271 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1272 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1273 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1274 // 'comments' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1275 else if (gvarp == &p_com) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1276 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1277 for (s = *varp; *s; ) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1278 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1279 while (*s && *s != ':') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1280 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1281 if (vim_strchr((char_u *)COM_ALL, *s) == NULL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1282 && !VIM_ISDIGIT(*s) && *s != '-') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1283 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1284 errmsg = illegal_char(errbuf, *s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1285 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1286 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1287 ++s; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1288 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1289 if (*s++ == NUL) |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
1290 errmsg = e_missing_colon; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1291 else if (*s == ',' || *s == NUL) |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
1292 errmsg = e_zero_length_string; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1293 if (errmsg != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1294 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1295 while (*s && *s != ',') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1296 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1297 if (*s == '\\' && s[1] != NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1298 ++s; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1299 ++s; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1300 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1301 s = skip_to_option_part(s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1302 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1303 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1304 |
29395
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1305 // global 'listchars' or 'fillchars' |
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1306 else if (varp == &p_lcs || varp == &p_fcs) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1307 { |
29395
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1308 char_u **local_ptr = varp == &p_lcs |
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1309 ? &curwin->w_p_lcs : &curwin->w_p_fcs; |
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1310 |
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1311 // only apply the global value to "curwin" when it does not have a |
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1312 // local value |
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1313 errmsg = set_chars_option(curwin, varp, |
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1314 **local_ptr == NUL || !(opt_flags & OPT_GLOBAL)); |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
1315 if (errmsg == NULL) |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
1316 { |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
1317 tabpage_T *tp; |
29387
9dce192d1ac2
patch 9.0.0036: 'fillchars' cannot have window-local values
Bram Moolenaar <Bram@vim.org>
parents:
29069
diff
changeset
|
1318 win_T *wp; |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
1319 |
29395
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1320 // If the current window is set to use the global |
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1321 // 'listchars'/'fillchars' value, clear the window-local value. |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
1322 if (!(opt_flags & OPT_GLOBAL)) |
29395
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1323 clear_string_option(local_ptr); |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
1324 FOR_ALL_TAB_WINDOWS(tp, wp) |
29395
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1325 { |
29391
73fb9c6efc6d
patch 9.0.0038: 'listchars' test fails
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
1326 // If the current window has a local value need to apply it |
73fb9c6efc6d
patch 9.0.0038: 'listchars' test fails
Bram Moolenaar <Bram@vim.org>
parents:
29387
diff
changeset
|
1327 // again, it was changed when setting the global value. |
26111
1d326bc99a09
patch 8.2.3588: break statement is never reached
Bram Moolenaar <Bram@vim.org>
parents:
26022
diff
changeset
|
1328 // If no error was returned above, we don't expect an error |
1d326bc99a09
patch 8.2.3588: break statement is never reached
Bram Moolenaar <Bram@vim.org>
parents:
26022
diff
changeset
|
1329 // here, so ignore the return value. |
29395
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1330 local_ptr = varp == &p_lcs ? &wp->w_p_lcs : &wp->w_p_fcs; |
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1331 if (**local_ptr == NUL) |
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1332 (void)set_chars_option(wp, local_ptr, TRUE); |
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1333 } |
26111
1d326bc99a09
patch 8.2.3588: break statement is never reached
Bram Moolenaar <Bram@vim.org>
parents:
26022
diff
changeset
|
1334 |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
1335 redraw_all_later(NOT_VALID); |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
1336 } |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1337 } |
23952
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
1338 // local 'listchars' |
44be09b25619
patch 8.2.2518: 'listchars' should be window-local
Bram Moolenaar <Bram@vim.org>
parents:
23810
diff
changeset
|
1339 else if (varp == &curwin->w_p_lcs) |
29395
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1340 errmsg = set_chars_option(curwin, varp, TRUE); |
29387
9dce192d1ac2
patch 9.0.0036: 'fillchars' cannot have window-local values
Bram Moolenaar <Bram@vim.org>
parents:
29069
diff
changeset
|
1341 |
9dce192d1ac2
patch 9.0.0036: 'fillchars' cannot have window-local values
Bram Moolenaar <Bram@vim.org>
parents:
29069
diff
changeset
|
1342 // local 'fillchars' |
9dce192d1ac2
patch 9.0.0036: 'fillchars' cannot have window-local values
Bram Moolenaar <Bram@vim.org>
parents:
29069
diff
changeset
|
1343 else if (varp == &curwin->w_p_fcs) |
9dce192d1ac2
patch 9.0.0036: 'fillchars' cannot have window-local values
Bram Moolenaar <Bram@vim.org>
parents:
29069
diff
changeset
|
1344 { |
29395
caaf5b270018
patch 9.0.0040: use of set_chars_option() is confusing
Bram Moolenaar <Bram@vim.org>
parents:
29391
diff
changeset
|
1345 errmsg = set_chars_option(curwin, varp, TRUE); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1346 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1347 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1348 #ifdef FEAT_CMDWIN |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1349 // 'cedit' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1350 else if (varp == &p_cedit) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1351 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1352 errmsg = check_cedit(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1353 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1354 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1355 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1356 // 'verbosefile' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1357 else if (varp == &p_vfile) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1358 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1359 verbose_stop(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1360 if (*p_vfile != NUL && verbose_open() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1361 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1362 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1363 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1364 #ifdef FEAT_VIMINFO |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1365 // 'viminfo' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1366 else if (varp == &p_viminfo) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1367 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1368 for (s = p_viminfo; *s;) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1369 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1370 // Check it's a valid character |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1371 if (vim_strchr((char_u *)"!\"%'/:<@cfhnrs", *s) == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1372 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1373 errmsg = illegal_char(errbuf, *s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1374 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1375 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1376 if (*s == 'n') // name is always last one |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1377 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1378 else if (*s == 'r') // skip until next ',' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1379 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1380 while (*++s && *s != ',') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1381 ; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1382 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1383 else if (*s == '%') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1384 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1385 // optional number |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1386 while (vim_isdigit(*++s)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1387 ; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1388 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1389 else if (*s == '!' || *s == 'h' || *s == 'c') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1390 ++s; // no extra chars |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1391 else // must have a number |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1392 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1393 while (vim_isdigit(*++s)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1394 ; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1395 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1396 if (!VIM_ISDIGIT(*(s - 1))) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1397 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1398 if (errbuf != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1399 { |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
1400 sprintf(errbuf, |
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
1401 _(e_missing_number_after_angle_str_angle), |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1402 transchar_byte(*(s - 1))); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1403 errmsg = errbuf; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1404 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1405 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1406 errmsg = ""; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1407 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1408 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1409 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1410 if (*s == ',') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1411 ++s; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1412 else if (*s) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1413 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1414 if (errbuf != NULL) |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
1415 errmsg = e_missing_comma; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1416 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1417 errmsg = ""; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1418 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1419 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1420 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1421 if (*p_viminfo && errmsg == NULL && get_viminfo_parameter('\'') < 0) |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
1422 errmsg = e_must_specify_a_value; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1423 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1424 #endif // FEAT_VIMINFO |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1425 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1426 // terminal options |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1427 else if (istermoption_idx(opt_idx) && full_screen) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1428 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1429 // ":set t_Co=0" and ":set t_Co=1" do ":set t_Co=" |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1430 if (varp == &T_CCO) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1431 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1432 int colors = atoi((char *)T_CCO); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1433 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1434 // Only reinitialize colors if t_Co value has really changed to |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1435 // avoid expensive reload of colorscheme if t_Co is set to the |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1436 // same value multiple times. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1437 if (colors != t_colors) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1438 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1439 t_colors = colors; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1440 if (t_colors <= 1) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1441 { |
29509
d61007cc39b3
patch 9.0.0096: flag "new_value_alloced" is always true
Bram Moolenaar <Bram@vim.org>
parents:
29395
diff
changeset
|
1442 vim_free(T_CCO); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1443 T_CCO = empty_option; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1444 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1445 #if defined(FEAT_VTP) && defined(FEAT_TERMGUICOLORS) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1446 if (is_term_win32()) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1447 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1448 swap_tcap(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1449 did_swaptcap = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1450 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1451 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1452 // We now have a different color setup, initialize it again. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1453 init_highlight(TRUE, FALSE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1454 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1455 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1456 ttest(FALSE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1457 if (varp == &T_ME) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1458 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1459 out_str(T_ME); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1460 redraw_later(CLEAR); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1461 #if defined(MSWIN) && (!defined(FEAT_GUI_MSWIN) || defined(VIMDLL)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1462 // Since t_me has been set, this probably means that the user |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1463 // wants to use this as default colors. Need to reset default |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1464 // background/foreground colors. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1465 # ifdef VIMDLL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1466 if (!gui.in_use && !gui.starting) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1467 # endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1468 mch_set_normal_colors(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1469 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1470 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1471 if (varp == &T_BE && termcap_active) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1472 { |
29069
be6c32395444
patch 8.2.5056: the channel log only contains some of the raw terminal output
Bram Moolenaar <Bram@vim.org>
parents:
28942
diff
changeset
|
1473 MAY_WANT_TO_LOG_THIS; |
be6c32395444
patch 8.2.5056: the channel log only contains some of the raw terminal output
Bram Moolenaar <Bram@vim.org>
parents:
28942
diff
changeset
|
1474 |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1475 if (*T_BE == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1476 // When clearing t_BE we assume the user no longer wants |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1477 // bracketed paste, thus disable it by writing t_BD. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1478 out_str(T_BD); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1479 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1480 out_str(T_BE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1481 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1482 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1483 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1484 #ifdef FEAT_LINEBREAK |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1485 // 'showbreak' |
18574
8b0114ffde2b
patch 8.1.2281: 'showbreak' cannot be set for one window
Bram Moolenaar <Bram@vim.org>
parents:
18396
diff
changeset
|
1486 else if (gvarp == &p_sbr) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1487 { |
18574
8b0114ffde2b
patch 8.1.2281: 'showbreak' cannot be set for one window
Bram Moolenaar <Bram@vim.org>
parents:
18396
diff
changeset
|
1488 for (s = *varp; *s; ) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1489 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1490 if (ptr2cells(s) != 1) |
28457
4dcccb2673fe
patch 8.2.4753: error from setting an option is silently ignored
Bram Moolenaar <Bram@vim.org>
parents:
28455
diff
changeset
|
1491 errmsg = e_showbreak_contains_unprintable_or_wide_character; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1492 MB_PTR_ADV(s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1493 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1494 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1495 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1496 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1497 #ifdef FEAT_GUI |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1498 // 'guifont' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1499 else if (varp == &p_guifont) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1500 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1501 if (gui.in_use) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1502 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1503 p = p_guifont; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1504 # if defined(FEAT_GUI_GTK) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1505 // Put up a font dialog and let the user select a new value. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1506 // If this is cancelled go back to the old value but don't |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1507 // give an error message. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1508 if (STRCMP(p, "*") == 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1509 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1510 p = gui_mch_font_dialog(oldval); |
29509
d61007cc39b3
patch 9.0.0096: flag "new_value_alloced" is always true
Bram Moolenaar <Bram@vim.org>
parents:
29395
diff
changeset
|
1511 free_string_option(p_guifont); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1512 p_guifont = (p != NULL) ? p : vim_strsave(oldval); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1513 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1514 # endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1515 if (p != NULL && gui_init_font(p_guifont, FALSE) != OK) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1516 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1517 # if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_PHOTON) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1518 if (STRCMP(p_guifont, "*") == 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1519 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1520 // Dialog was cancelled: Keep the old value without giving |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1521 // an error message. |
29509
d61007cc39b3
patch 9.0.0096: flag "new_value_alloced" is always true
Bram Moolenaar <Bram@vim.org>
parents:
29395
diff
changeset
|
1522 free_string_option(p_guifont); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1523 p_guifont = vim_strsave(oldval); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1524 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1525 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1526 # endif |
28457
4dcccb2673fe
patch 8.2.4753: error from setting an option is silently ignored
Bram Moolenaar <Bram@vim.org>
parents:
28455
diff
changeset
|
1527 errmsg = e_invalid_fonts; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1528 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1529 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1530 redraw_gui_only = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1531 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1532 # ifdef FEAT_XFONTSET |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1533 else if (varp == &p_guifontset) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1534 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1535 if (STRCMP(p_guifontset, "*") == 0) |
28457
4dcccb2673fe
patch 8.2.4753: error from setting an option is silently ignored
Bram Moolenaar <Bram@vim.org>
parents:
28455
diff
changeset
|
1536 errmsg = e_cant_select_fontset; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1537 else if (gui.in_use && gui_init_font(p_guifontset, TRUE) != OK) |
28457
4dcccb2673fe
patch 8.2.4753: error from setting an option is silently ignored
Bram Moolenaar <Bram@vim.org>
parents:
28455
diff
changeset
|
1538 errmsg = e_invalid_fontset; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1539 redraw_gui_only = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1540 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1541 # endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1542 else if (varp == &p_guifontwide) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1543 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1544 if (STRCMP(p_guifontwide, "*") == 0) |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
1545 errmsg = e_cant_select_wide_font; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1546 else if (gui_get_wide_font() == FAIL) |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
1547 errmsg = e_invalid_wide_font; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1548 redraw_gui_only = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1549 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1550 #endif |
25982
aade8ef975d5
patch 8.2.3524: GUI: ligatures are not used
Bram Moolenaar <Bram@vim.org>
parents:
25974
diff
changeset
|
1551 # if defined(FEAT_GUI_GTK) |
aade8ef975d5
patch 8.2.3524: GUI: ligatures are not used
Bram Moolenaar <Bram@vim.org>
parents:
25974
diff
changeset
|
1552 else if (varp == &p_guiligatures) |
aade8ef975d5
patch 8.2.3524: GUI: ligatures are not used
Bram Moolenaar <Bram@vim.org>
parents:
25974
diff
changeset
|
1553 { |
aade8ef975d5
patch 8.2.3524: GUI: ligatures are not used
Bram Moolenaar <Bram@vim.org>
parents:
25974
diff
changeset
|
1554 gui_set_ligatures(); |
aade8ef975d5
patch 8.2.3524: GUI: ligatures are not used
Bram Moolenaar <Bram@vim.org>
parents:
25974
diff
changeset
|
1555 redraw_gui_only = TRUE; |
aade8ef975d5
patch 8.2.3524: GUI: ligatures are not used
Bram Moolenaar <Bram@vim.org>
parents:
25974
diff
changeset
|
1556 } |
aade8ef975d5
patch 8.2.3524: GUI: ligatures are not used
Bram Moolenaar <Bram@vim.org>
parents:
25974
diff
changeset
|
1557 # endif |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1558 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1559 #ifdef CURSOR_SHAPE |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1560 // 'guicursor' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1561 else if (varp == &p_guicursor) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1562 errmsg = parse_shape_opt(SHAPE_CURSOR); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1563 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1564 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1565 #ifdef FEAT_MOUSESHAPE |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1566 // 'mouseshape' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1567 else if (varp == &p_mouseshape) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1568 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1569 errmsg = parse_shape_opt(SHAPE_MOUSE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1570 update_mouseshape(-1); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1571 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1572 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1573 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1574 #ifdef FEAT_PRINTER |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1575 else if (varp == &p_popt) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1576 errmsg = parse_printoptions(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1577 # if defined(FEAT_POSTSCRIPT) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1578 else if (varp == &p_pmfn) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1579 errmsg = parse_printmbfont(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1580 # endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1581 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1582 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1583 #ifdef FEAT_LANGMAP |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1584 // 'langmap' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1585 else if (varp == &p_langmap) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1586 langmap_set(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1587 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1588 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1589 #ifdef FEAT_LINEBREAK |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1590 // 'breakat' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1591 else if (varp == &p_breakat) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1592 fill_breakat_flags(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1593 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1594 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1595 // 'titlestring' and 'iconstring' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1596 else if (varp == &p_titlestring || varp == &p_iconstring) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1597 { |
26336
a2e6da79274d
patch 8.2.3699: the +title feature adds a lot of #ifdef but little code
Bram Moolenaar <Bram@vim.org>
parents:
26268
diff
changeset
|
1598 #ifdef FEAT_STL_OPT |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1599 int flagval = (varp == &p_titlestring) ? STL_IN_TITLE : STL_IN_ICON; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1600 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1601 // NULL => statusline syntax |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1602 if (vim_strchr(*varp, '%') && check_stl_option(*varp) == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1603 stl_syntax |= flagval; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1604 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1605 stl_syntax &= ~flagval; |
26336
a2e6da79274d
patch 8.2.3699: the +title feature adds a lot of #ifdef but little code
Bram Moolenaar <Bram@vim.org>
parents:
26268
diff
changeset
|
1606 #endif |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1607 did_set_title(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1608 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1609 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1610 #ifdef FEAT_GUI |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1611 // 'guioptions' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1612 else if (varp == &p_go) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1613 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1614 gui_init_which_components(oldval); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1615 redraw_gui_only = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1616 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1617 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1618 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1619 #if defined(FEAT_GUI_TABLINE) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1620 // 'guitablabel' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1621 else if (varp == &p_gtl) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1622 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1623 redraw_tabline = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1624 redraw_gui_only = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1625 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1626 // 'guitabtooltip' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1627 else if (varp == &p_gtt) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1628 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1629 redraw_gui_only = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1630 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1631 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1632 |
18354
9f51d0cef8da
patch 8.1.2171: mouse support not always available
Bram Moolenaar <Bram@vim.org>
parents:
18303
diff
changeset
|
1633 #if defined(UNIX) || defined(VMS) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1634 // 'ttymouse' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1635 else if (varp == &p_ttym) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1636 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1637 // Switch the mouse off before changing the escape sequences used for |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1638 // that. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1639 mch_setmouse(FALSE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1640 if (opt_strings_flags(p_ttym, p_ttym_values, &ttym_flags, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1641 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1642 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1643 check_mouse_termcode(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1644 if (termcap_active) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1645 setmouse(); // may switch it on again |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1646 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1647 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1648 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1649 // 'selection' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1650 else if (varp == &p_sel) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1651 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1652 if (*p_sel == NUL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1653 || check_opt_strings(p_sel, p_sel_values, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1654 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1655 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1656 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1657 // 'selectmode' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1658 else if (varp == &p_slm) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1659 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1660 if (check_opt_strings(p_slm, p_slm_values, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1661 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1662 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1663 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1664 #ifdef FEAT_BROWSE |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1665 // 'browsedir' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1666 else if (varp == &p_bsdir) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1667 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1668 if (check_opt_strings(p_bsdir, p_bsdir_values, FALSE) != OK |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1669 && !mch_isdir(p_bsdir)) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1670 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1671 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1672 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1673 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1674 // 'keymodel' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1675 else if (varp == &p_km) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1676 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1677 if (check_opt_strings(p_km, p_km_values, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1678 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1679 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1680 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1681 km_stopsel = (vim_strchr(p_km, 'o') != NULL); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1682 km_startsel = (vim_strchr(p_km, 'a') != NULL); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1683 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1684 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1685 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1686 // 'mousemodel' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1687 else if (varp == &p_mousem) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1688 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1689 if (check_opt_strings(p_mousem, p_mousem_values, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1690 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1691 #if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU) && (XmVersion <= 1002) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1692 else if (*p_mousem != *oldval) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1693 // Changed from "extend" to "popup" or "popup_setpos" or vv: need |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1694 // to create or delete the popup menus. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1695 gui_motif_update_mousemodel(root_menu); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1696 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1697 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1698 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1699 // 'switchbuf' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1700 else if (varp == &p_swb) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1701 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1702 if (opt_strings_flags(p_swb, p_swb_values, &swb_flags, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1703 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1704 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1705 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1706 // 'debug' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1707 else if (varp == &p_debug) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1708 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1709 if (check_opt_strings(p_debug, p_debug_values, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1710 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1711 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1712 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1713 // 'display' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1714 else if (varp == &p_dy) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1715 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1716 if (opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1717 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1718 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1719 (void)init_chartab(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1720 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1721 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1722 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1723 // 'eadirection' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1724 else if (varp == &p_ead) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1725 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1726 if (check_opt_strings(p_ead, p_ead_values, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1727 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1728 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1729 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1730 #ifdef FEAT_CLIPBOARD |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1731 // 'clipboard' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1732 else if (varp == &p_cb) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1733 errmsg = check_clipboard_option(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1734 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1735 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1736 #ifdef FEAT_SPELL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1737 // When 'spelllang' or 'spellfile' is set and there is a window for this |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1738 // buffer in which 'spell' is set load the wordlists. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1739 else if (varp == &(curwin->w_s->b_p_spl) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1740 || varp == &(curwin->w_s->b_p_spf)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1741 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1742 int is_spellfile = varp == &(curwin->w_s->b_p_spf); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1743 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1744 if ((is_spellfile && !valid_spellfile(*varp)) |
20760
813b9a7064a4
patch 8.2.0932: missspelling spelllang
Bram Moolenaar <Bram@vim.org>
parents:
20613
diff
changeset
|
1745 || (!is_spellfile && !valid_spelllang(*varp))) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1746 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1747 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1748 errmsg = did_set_spell_option(is_spellfile); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1749 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1750 // When 'spellcapcheck' is set compile the regexp program. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1751 else if (varp == &(curwin->w_s->b_p_spc)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1752 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1753 errmsg = compile_cap_prog(curwin->w_s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1754 } |
20802
ed00f0fbdaef
patch 8.2.0953: spell checking doesn't work for CamelCased words
Bram Moolenaar <Bram@vim.org>
parents:
20760
diff
changeset
|
1755 // 'spelloptions' |
ed00f0fbdaef
patch 8.2.0953: spell checking doesn't work for CamelCased words
Bram Moolenaar <Bram@vim.org>
parents:
20760
diff
changeset
|
1756 else if (varp == &(curwin->w_s->b_p_spo)) |
ed00f0fbdaef
patch 8.2.0953: spell checking doesn't work for CamelCased words
Bram Moolenaar <Bram@vim.org>
parents:
20760
diff
changeset
|
1757 { |
ed00f0fbdaef
patch 8.2.0953: spell checking doesn't work for CamelCased words
Bram Moolenaar <Bram@vim.org>
parents:
20760
diff
changeset
|
1758 if (**varp != NUL && STRCMP("camel", *varp) != 0) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1759 errmsg = e_invalid_argument; |
20802
ed00f0fbdaef
patch 8.2.0953: spell checking doesn't work for CamelCased words
Bram Moolenaar <Bram@vim.org>
parents:
20760
diff
changeset
|
1760 } |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1761 // 'spellsuggest' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1762 else if (varp == &p_sps) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1763 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1764 if (spell_check_sps() != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1765 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1766 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1767 // 'mkspellmem' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1768 else if (varp == &p_msm) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1769 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1770 if (spell_check_msm() != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1771 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1772 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1773 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1774 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1775 // When 'bufhidden' is set, check for valid value. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1776 else if (gvarp == &p_bh) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1777 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1778 if (check_opt_strings(curbuf->b_p_bh, p_bufhidden_values, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1779 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1780 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1781 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1782 // When 'buftype' is set, check for valid value. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1783 else if (gvarp == &p_bt) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1784 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1785 if (check_opt_strings(curbuf->b_p_bt, p_buftype_values, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1786 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1787 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1788 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1789 if (curwin->w_status_height) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1790 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1791 curwin->w_redr_status = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1792 redraw_later(VALID); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1793 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1794 curbuf->b_help = (curbuf->b_p_bt[0] == 'h'); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1795 redraw_titles(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1796 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1797 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1798 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1799 #ifdef FEAT_STL_OPT |
28455
8f4f16efeeb3
patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents:
28451
diff
changeset
|
1800 // 'statusline', 'tabline' or 'rulerformat' |
8f4f16efeeb3
patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents:
28451
diff
changeset
|
1801 else if (gvarp == &p_stl || varp == &p_tal || varp == &p_ruf) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1802 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1803 int wid; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1804 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1805 if (varp == &p_ruf) // reset ru_wid first |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1806 ru_wid = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1807 s = *varp; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1808 if (varp == &p_ruf && *s == '%') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1809 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1810 // set ru_wid if 'ruf' starts with "%99(" |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1811 if (*++s == '-') // ignore a '-' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1812 s++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1813 wid = getdigits(&s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1814 if (wid && *s == '(' && (errmsg = check_stl_option(p_ruf)) == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1815 ru_wid = wid; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1816 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1817 errmsg = check_stl_option(p_ruf); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1818 } |
28455
8f4f16efeeb3
patch 8.2.4752: wrong 'statusline' value can cause illegal memory access
Bram Moolenaar <Bram@vim.org>
parents:
28451
diff
changeset
|
1819 // check 'statusline' or 'tabline' only if it doesn't start with "%!" |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1820 else if (varp == &p_ruf || s[0] != '%' || s[1] != '!') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1821 errmsg = check_stl_option(s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1822 if (varp == &p_ruf && errmsg == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1823 comp_col(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1824 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1825 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1826 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1827 // check if it is a valid value for 'complete' -- Acevedo |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1828 else if (gvarp == &p_cpt) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1829 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1830 for (s = *varp; *s;) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1831 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1832 while (*s == ',' || *s == ' ') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1833 s++; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1834 if (!*s) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1835 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1836 if (vim_strchr((char_u *)".wbuksid]tU", *s) == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1837 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1838 errmsg = illegal_char(errbuf, *s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1839 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1840 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1841 if (*++s != NUL && *s != ',' && *s != ' ') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1842 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1843 if (s[-1] == 'k' || s[-1] == 's') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1844 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1845 // skip optional filename after 'k' and 's' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1846 while (*s && *s != ',' && *s != ' ') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1847 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1848 if (*s == '\\' && s[1] != NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1849 ++s; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1850 ++s; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1851 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1852 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1853 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1854 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1855 if (errbuf != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1856 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1857 sprintf((char *)errbuf, |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
1858 _(e_illegal_character_after_chr), *--s); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1859 errmsg = errbuf; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1860 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1861 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1862 errmsg = ""; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1863 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1864 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1865 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1866 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1867 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1868 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1869 // 'completeopt' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1870 else if (varp == &p_cot) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1871 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1872 if (check_opt_strings(p_cot, p_cot_values, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1873 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1874 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1875 completeopt_was_set(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1876 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1877 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1878 #ifdef BACKSLASH_IN_FILENAME |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1879 // 'completeslash' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1880 else if (gvarp == &p_csl) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1881 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1882 if (check_opt_strings(p_csl, p_csl_values, FALSE) != OK |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1883 || check_opt_strings(curbuf->b_p_csl, p_csl_values, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1884 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1885 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1886 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1887 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1888 #ifdef FEAT_SIGNS |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1889 // 'signcolumn' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1890 else if (varp == &curwin->w_p_scl) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1891 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1892 if (check_opt_strings(*varp, p_scl_values, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1893 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1894 // When changing the 'signcolumn' to or from 'number', recompute the |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1895 // width of the number column if 'number' or 'relativenumber' is set. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1896 if (((*oldval == 'n' && *(oldval + 1) == 'u') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1897 || (*curwin->w_p_scl == 'n' && *(curwin->w_p_scl + 1) =='u')) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1898 && (curwin->w_p_nu || curwin->w_p_rnu)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1899 curwin->w_nrwidth_line_count = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1900 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1901 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1902 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1903 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1904 #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1905 // 'toolbar' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1906 else if (varp == &p_toolbar) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1907 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1908 if (opt_strings_flags(p_toolbar, p_toolbar_values, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1909 &toolbar_flags, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1910 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1911 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1912 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1913 out_flush(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1914 gui_mch_show_toolbar((toolbar_flags & |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1915 (TOOLBAR_TEXT | TOOLBAR_ICONS)) != 0); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1916 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1917 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1918 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1919 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1920 #if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_GTK) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1921 // 'toolbariconsize': GTK+ 2 only |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1922 else if (varp == &p_tbis) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1923 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1924 if (opt_strings_flags(p_tbis, p_tbis_values, &tbis_flags, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1925 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1926 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1927 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1928 out_flush(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1929 gui_mch_show_toolbar((toolbar_flags & |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1930 (TOOLBAR_TEXT | TOOLBAR_ICONS)) != 0); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1931 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1932 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1933 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1934 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1935 // 'pastetoggle': translate key codes like in a mapping |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1936 else if (varp == &p_pt) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1937 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1938 if (*p_pt) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1939 { |
18303
86887d3fd6f7
patch 8.1.2146: build failure
Bram Moolenaar <Bram@vim.org>
parents:
18203
diff
changeset
|
1940 (void)replace_termcodes(p_pt, &p, |
86887d3fd6f7
patch 8.1.2146: build failure
Bram Moolenaar <Bram@vim.org>
parents:
18203
diff
changeset
|
1941 REPTERM_FROM_PART | REPTERM_DO_LT, NULL); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1942 if (p != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1943 { |
29509
d61007cc39b3
patch 9.0.0096: flag "new_value_alloced" is always true
Bram Moolenaar <Bram@vim.org>
parents:
29395
diff
changeset
|
1944 free_string_option(p_pt); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1945 p_pt = p; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1946 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1947 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1948 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1949 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1950 // 'backspace' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1951 else if (varp == &p_bs) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1952 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1953 if (VIM_ISDIGIT(*p_bs)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1954 { |
20069
9a67d41708d2
patch 8.2.0590: no 'backspace' value allows ignoring the insertion point
Bram Moolenaar <Bram@vim.org>
parents:
19675
diff
changeset
|
1955 if (*p_bs > '3' || p_bs[1] != NUL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1956 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1957 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1958 else if (check_opt_strings(p_bs, p_bs_values, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1959 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1960 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1961 else if (varp == &p_bo) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1962 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1963 if (opt_strings_flags(p_bo, p_bo_values, &bo_flags, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1964 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1965 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1966 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1967 // 'tagcase' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1968 else if (gvarp == &p_tc) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1969 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1970 unsigned int *flags; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1971 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1972 if (opt_flags & OPT_LOCAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1973 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1974 p = curbuf->b_p_tc; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1975 flags = &curbuf->b_tc_flags; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1976 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1977 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1978 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1979 p = p_tc; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1980 flags = &tc_flags; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1981 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1982 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1983 if ((opt_flags & OPT_LOCAL) && *p == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1984 // make the local value empty: use the global value |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1985 *flags = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1986 else if (*p == NUL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1987 || opt_strings_flags(p, p_tc_values, flags, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1988 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1989 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1990 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1991 // 'casemap' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1992 else if (varp == &p_cmp) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1993 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1994 if (opt_strings_flags(p_cmp, p_cmp_values, &cmp_flags, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
1995 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1996 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1997 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1998 #ifdef FEAT_DIFF |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1999 // 'diffopt' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2000 else if (varp == &p_dip) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2001 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2002 if (diffopt_changed() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2003 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2004 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2005 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2006 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2007 #ifdef FEAT_FOLDING |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2008 // 'foldmethod' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2009 else if (gvarp == &curwin->w_allbuf_opt.wo_fdm) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2010 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2011 if (check_opt_strings(*varp, p_fdm_values, FALSE) != OK |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2012 || *curwin->w_p_fdm == NUL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2013 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2014 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2015 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2016 foldUpdateAll(curwin); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2017 if (foldmethodIsDiff(curwin)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2018 newFoldLevel(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2019 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2020 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2021 // 'foldmarker' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2022 else if (gvarp == &curwin->w_allbuf_opt.wo_fmr) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2023 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2024 p = vim_strchr(*varp, ','); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2025 if (p == NULL) |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
2026 errmsg = e_comma_required; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2027 else if (p == *varp || p[1] == NUL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2028 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2029 else if (foldmethodIsMarker(curwin)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2030 foldUpdateAll(curwin); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2031 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2032 // 'commentstring' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2033 else if (gvarp == &p_cms) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2034 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2035 if (**varp != NUL && strstr((char *)*varp, "%s") == NULL) |
26917
d91aea2a612c
patch 8.2.3987: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26883
diff
changeset
|
2036 errmsg = e_commentstring_must_be_empty_or_contain_str; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2037 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2038 // 'foldopen' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2039 else if (varp == &p_fdo) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2040 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2041 if (opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2042 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2043 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2044 // 'foldclose' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2045 else if (varp == &p_fcl) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2046 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2047 if (check_opt_strings(p_fcl, p_fcl_values, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2048 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2049 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2050 // 'foldignore' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2051 else if (gvarp == &curwin->w_allbuf_opt.wo_fdi) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2052 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2053 if (foldmethodIsIndent(curwin)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2054 foldUpdateAll(curwin); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2055 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2056 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2057 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2058 // 'virtualedit' |
25380
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2059 else if (gvarp == &p_ve) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2060 { |
25380
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2061 char_u *ve = p_ve; |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2062 unsigned int *flags = &ve_flags; |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2063 |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2064 if (opt_flags & OPT_LOCAL) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2065 { |
25487
c26ff3203b43
patch 8.2.3280: 'virtualedit' local to buffer is not the best solution
Bram Moolenaar <Bram@vim.org>
parents:
25380
diff
changeset
|
2066 ve = curwin->w_p_ve; |
c26ff3203b43
patch 8.2.3280: 'virtualedit' local to buffer is not the best solution
Bram Moolenaar <Bram@vim.org>
parents:
25380
diff
changeset
|
2067 flags = &curwin->w_ve_flags; |
25380
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2068 } |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2069 |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2070 if ((opt_flags & OPT_LOCAL) && *ve == NUL) |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2071 // make the local value empty: use the global value |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2072 *flags = 0; |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2073 else |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2074 { |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2075 if (opt_strings_flags(ve, p_ve_values, flags, TRUE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2076 errmsg = e_invalid_argument; |
25380
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2077 else if (STRCMP(p_ve, oldval) != 0) |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2078 { |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2079 // Recompute cursor position in case the new 've' setting |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2080 // changes something. |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2081 validate_virtcol(); |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2082 coladvance(curwin->w_virtcol); |
ac88cd21ae88
patch 8.2.3227: 'virtualedit' can only be set globally
Bram Moolenaar <Bram@vim.org>
parents:
25064
diff
changeset
|
2083 } |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2084 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2085 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2086 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2087 #if defined(FEAT_CSCOPE) && defined(FEAT_QUICKFIX) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2088 else if (varp == &p_csqf) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2089 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2090 if (p_csqf != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2091 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2092 p = p_csqf; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2093 while (*p != NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2094 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2095 if (vim_strchr((char_u *)CSQF_CMDS, *p) == NULL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2096 || p[1] == NUL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2097 || vim_strchr((char_u *)CSQF_FLAGS, p[1]) == NULL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2098 || (p[2] != NUL && p[2] != ',')) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2099 { |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2100 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2101 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2102 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2103 else if (p[2] == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2104 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2105 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2106 p += 3; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2107 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2108 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2109 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2110 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2111 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2112 // 'cinoptions' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2113 else if (gvarp == &p_cino) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2114 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2115 // TODO: recognize errors |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2116 parse_cino(curbuf); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2117 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2118 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2119 #if defined(FEAT_RENDER_OPTIONS) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2120 // 'renderoptions' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2121 else if (varp == &p_rop) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2122 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2123 if (!gui_mch_set_rendering_options(p_rop)) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2124 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2125 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2126 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2127 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2128 else if (gvarp == &p_ft) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2129 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2130 if (!valid_filetype(*varp)) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2131 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2132 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2133 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2134 value_changed = STRCMP(oldval, *varp) != 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2135 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2136 // Since we check the value, there is no need to set P_INSECURE, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2137 // even when the value comes from a modeline. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2138 *value_checked = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2139 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2140 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2141 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2142 #ifdef FEAT_SYN_HL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2143 else if (gvarp == &p_syn) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2144 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2145 if (!valid_filetype(*varp)) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2146 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2147 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2148 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2149 value_changed = STRCMP(oldval, *varp) != 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2150 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2151 // Since we check the value, there is no need to set P_INSECURE, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2152 // even when the value comes from a modeline. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2153 *value_checked = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2154 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2155 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2156 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2157 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2158 #ifdef FEAT_TERMINAL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2159 // 'termwinkey' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2160 else if (varp == &curwin->w_p_twk) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2161 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2162 if (*curwin->w_p_twk != NUL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2163 && string_to_key(curwin->w_p_twk, TRUE) == 0) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2164 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2165 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2166 // 'termwinsize' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2167 else if (varp == &curwin->w_p_tws) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2168 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2169 if (*curwin->w_p_tws != NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2170 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2171 p = skipdigits(curwin->w_p_tws); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2172 if (p == curwin->w_p_tws |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2173 || (*p != 'x' && *p != '*') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2174 || *skipdigits(p + 1) != NUL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2175 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2176 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2177 } |
19265
ce8c47ed54e5
patch 8.2.0191: cannot put a terminal in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
18763
diff
changeset
|
2178 // 'wincolor' |
ce8c47ed54e5
patch 8.2.0191: cannot put a terminal in a popup window
Bram Moolenaar <Bram@vim.org>
parents:
18763
diff
changeset
|
2179 else if (varp == &curwin->w_p_wcr) |
26193
c83460a14407
patch 8.2.3628: looking terminal colors is a bit slow
Bram Moolenaar <Bram@vim.org>
parents:
26175
diff
changeset
|
2180 term_update_wincolor(curwin); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2181 # if defined(MSWIN) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2182 // 'termwintype' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2183 else if (varp == &p_twt) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2184 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2185 if (check_opt_strings(*varp, p_twt_values, FALSE) != OK) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2186 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2187 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2188 # endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2189 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2190 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2191 #ifdef FEAT_VARTABS |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2192 // 'varsofttabstop' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2193 else if (varp == &(curbuf->b_p_vsts)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2194 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2195 char_u *cp; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2196 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2197 if (!(*varp)[0] || ((*varp)[0] == '0' && !(*varp)[1])) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2198 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2199 if (curbuf->b_p_vsts_array) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2200 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2201 vim_free(curbuf->b_p_vsts_array); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2202 curbuf->b_p_vsts_array = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2203 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2204 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2205 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2206 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2207 for (cp = *varp; *cp; ++cp) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2208 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2209 if (vim_isdigit(*cp)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2210 continue; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2211 if (*cp == ',' && cp > *varp && *(cp-1) != ',') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2212 continue; |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2213 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2214 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2215 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2216 if (errmsg == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2217 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2218 int *oldarray = curbuf->b_p_vsts_array; |
25733
4b2616ffe32b
patch 8.2.3402: invalid memory access when using :retab with large value
Bram Moolenaar <Bram@vim.org>
parents:
25487
diff
changeset
|
2219 if (tabstop_set(*varp, &(curbuf->b_p_vsts_array)) == OK) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2220 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2221 if (oldarray) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2222 vim_free(oldarray); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2223 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2224 else |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2225 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2226 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2227 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2228 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2229 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2230 // 'vartabstop' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2231 else if (varp == &(curbuf->b_p_vts)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2232 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2233 char_u *cp; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2234 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2235 if (!(*varp)[0] || ((*varp)[0] == '0' && !(*varp)[1])) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2236 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2237 if (curbuf->b_p_vts_array) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2238 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2239 vim_free(curbuf->b_p_vts_array); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2240 curbuf->b_p_vts_array = NULL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2241 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2242 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2243 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2244 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2245 for (cp = *varp; *cp; ++cp) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2246 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2247 if (vim_isdigit(*cp)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2248 continue; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2249 if (*cp == ',' && cp > *varp && *(cp-1) != ',') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2250 continue; |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2251 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2252 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2253 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2254 if (errmsg == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2255 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2256 int *oldarray = curbuf->b_p_vts_array; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2257 |
25733
4b2616ffe32b
patch 8.2.3402: invalid memory access when using :retab with large value
Bram Moolenaar <Bram@vim.org>
parents:
25487
diff
changeset
|
2258 if (tabstop_set(*varp, &(curbuf->b_p_vts_array)) == OK) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2259 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2260 vim_free(oldarray); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2261 #ifdef FEAT_FOLDING |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2262 if (foldmethodIsIndent(curwin)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2263 foldUpdateAll(curwin); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2264 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2265 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2266 else |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2267 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2268 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2269 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2270 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2271 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2272 |
18763
49b78d6465e5
patch 8.1.2371: FEAT_TEXT_PROP is a confusing name
Bram Moolenaar <Bram@vim.org>
parents:
18646
diff
changeset
|
2273 #ifdef FEAT_PROP_POPUP |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2274 // 'previewpopup' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2275 else if (varp == &p_pvp) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2276 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2277 if (parse_previewpopup(NULL) == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2278 errmsg = e_invalid_argument; |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2279 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2280 # ifdef FEAT_QUICKFIX |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2281 // 'completepopup' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2282 else if (varp == &p_cpp) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2283 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2284 if (parse_completepopup(NULL) == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2285 errmsg = e_invalid_argument; |
21373
3d73cdd173ab
patch 8.2.1237: changing 'completepopup' after opening popup has no effect
Bram Moolenaar <Bram@vim.org>
parents:
20802
diff
changeset
|
2286 else |
3d73cdd173ab
patch 8.2.1237: changing 'completepopup' after opening popup has no effect
Bram Moolenaar <Bram@vim.org>
parents:
20802
diff
changeset
|
2287 popup_close_info(); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2288 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2289 # endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2290 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2291 |
26743
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2292 #ifdef FEAT_EVAL |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2293 // '*expr' options |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2294 else if ( |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2295 # ifdef FEAT_BEVAL |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2296 varp == &p_bexpr || |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2297 # endif |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2298 # ifdef FEAT_DIFF |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2299 varp == &p_dex || |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2300 # endif |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2301 # ifdef FEAT_FOLDING |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2302 varp == &curwin->w_p_fde || |
26759
31c23760d590
patch 8.2.3908: cannot use a script-local function for 'foldtext'
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
2303 varp == &curwin->w_p_fdt || |
26743
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2304 # endif |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2305 gvarp == &p_fex || |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2306 # ifdef FEAT_FIND_ID |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2307 gvarp == &p_inex || |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2308 # endif |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2309 gvarp == &p_inde || |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2310 # ifdef FEAT_DIFF |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2311 varp == &p_pex || |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2312 # endif |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2313 # ifdef FEAT_POSTSCRIPT |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2314 varp == &p_pexpr || |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2315 # endif |
27330
aeadf4315bef
patch 8.2.4193: cannot use an import in 'charconvert'
Bram Moolenaar <Bram@vim.org>
parents:
27018
diff
changeset
|
2316 varp == &p_ccv) |
26743
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2317 { |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2318 char_u **p_opt = NULL; |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2319 char_u *name; |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2320 |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2321 // If the option value starts with <SID> or s:, then replace that with |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2322 // the script identifier. |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2323 # ifdef FEAT_BEVAL |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2324 if (varp == &p_bexpr) // 'balloonexpr' |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2325 p_opt = (opt_flags & OPT_LOCAL) ? &curbuf->b_p_bexpr : &p_bexpr; |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2326 # endif |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2327 # ifdef FEAT_DIFF |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2328 if (varp == &p_dex) // 'diffexpr' |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2329 p_opt = &p_dex; |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2330 # endif |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2331 # ifdef FEAT_FOLDING |
26759
31c23760d590
patch 8.2.3908: cannot use a script-local function for 'foldtext'
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
2332 if (varp == &curwin->w_p_fde) // 'foldexpr' |
26743
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2333 p_opt = &curwin->w_p_fde; |
26759
31c23760d590
patch 8.2.3908: cannot use a script-local function for 'foldtext'
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
2334 if (varp == &curwin->w_p_fdt) // 'foldtext' |
31c23760d590
patch 8.2.3908: cannot use a script-local function for 'foldtext'
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
2335 p_opt = &curwin->w_p_fdt; |
26743
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2336 # endif |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2337 if (gvarp == &p_fex) // 'formatexpr' |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2338 p_opt = &curbuf->b_p_fex; |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2339 # ifdef FEAT_FIND_ID |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2340 if (gvarp == &p_inex) // 'includeexpr' |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2341 p_opt = &curbuf->b_p_inex; |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2342 # endif |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2343 if (gvarp == &p_inde) // 'indentexpr' |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2344 p_opt = &curbuf->b_p_inde; |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2345 # ifdef FEAT_DIFF |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2346 if (varp == &p_pex) // 'patchexpr' |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2347 p_opt = &p_pex; |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2348 # endif |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2349 # ifdef FEAT_POSTSCRIPT |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2350 if (varp == &p_pexpr) // 'printexpr' |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2351 p_opt = &p_pexpr; |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2352 # endif |
27330
aeadf4315bef
patch 8.2.4193: cannot use an import in 'charconvert'
Bram Moolenaar <Bram@vim.org>
parents:
27018
diff
changeset
|
2353 if (varp == &p_ccv) // 'charconvert' |
aeadf4315bef
patch 8.2.4193: cannot use an import in 'charconvert'
Bram Moolenaar <Bram@vim.org>
parents:
27018
diff
changeset
|
2354 p_opt = &p_ccv; |
26743
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2355 |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2356 if (p_opt != NULL) |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2357 { |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2358 name = get_scriptlocal_funcname(*p_opt); |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2359 if (name != NULL) |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2360 { |
29509
d61007cc39b3
patch 9.0.0096: flag "new_value_alloced" is always true
Bram Moolenaar <Bram@vim.org>
parents:
29395
diff
changeset
|
2361 free_string_option(*p_opt); |
26743
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2362 *p_opt = name; |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2363 } |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2364 } |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2365 |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2366 # ifdef FEAT_FOLDING |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2367 if (varp == &curwin->w_p_fde && foldmethodIsExpr(curwin)) |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2368 foldUpdateAll(curwin); |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2369 # endif |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2370 } |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2371 #endif |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26408
diff
changeset
|
2372 |
26388
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2373 #ifdef FEAT_COMPL_FUNC |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2374 // 'completefunc' |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2375 else if (gvarp == &p_cfu) |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2376 { |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2377 if (set_completefunc_option() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2378 errmsg = e_invalid_argument; |
26388
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2379 } |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2380 |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2381 // 'omnifunc' |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2382 else if (gvarp == &p_ofu) |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2383 { |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2384 if (set_omnifunc_option() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2385 errmsg = e_invalid_argument; |
26388
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2386 } |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2387 |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2388 // 'thesaurusfunc' |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2389 else if (gvarp == &p_tsrfu) |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2390 { |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2391 if (set_thesaurusfunc_option() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2392 errmsg = e_invalid_argument; |
26388
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2393 } |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2394 #endif |
8aba638e91eb
patch 8.2.3725: cannot use a lambda for 'completefunc' and 'omnifunc'
Bram Moolenaar <Bram@vim.org>
parents:
26336
diff
changeset
|
2395 |
26408
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2396 #if defined(FEAT_EVAL) && \ |
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2397 (defined(FEAT_XIM) || defined(IME_WITHOUT_XIM) || defined(VIMDLL)) |
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2398 // 'imactivatefunc' |
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2399 else if (gvarp == &p_imaf) |
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2400 { |
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2401 if (set_imactivatefunc_option() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2402 errmsg = e_invalid_argument; |
26408
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2403 } |
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2404 |
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2405 // 'imstatusfunc' |
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2406 else if (gvarp == &p_imsf) |
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2407 { |
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2408 if (set_imstatusfunc_option() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2409 errmsg = e_invalid_argument; |
26408
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2410 } |
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2411 #endif |
8f17f8f327f3
patch 8.2.3735: cannot use a lambda for 'imactivatefunc'
Bram Moolenaar <Bram@vim.org>
parents:
26388
diff
changeset
|
2412 |
26175
6b4f017d7005
patch 8.2.3619: cannot use a lambda for 'operatorfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26111
diff
changeset
|
2413 // 'operatorfunc' |
6b4f017d7005
patch 8.2.3619: cannot use a lambda for 'operatorfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26111
diff
changeset
|
2414 else if (varp == &p_opfunc) |
6b4f017d7005
patch 8.2.3619: cannot use a lambda for 'operatorfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26111
diff
changeset
|
2415 { |
6b4f017d7005
patch 8.2.3619: cannot use a lambda for 'operatorfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26111
diff
changeset
|
2416 if (set_operatorfunc_option() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2417 errmsg = e_invalid_argument; |
26175
6b4f017d7005
patch 8.2.3619: cannot use a lambda for 'operatorfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26111
diff
changeset
|
2418 } |
6b4f017d7005
patch 8.2.3619: cannot use a lambda for 'operatorfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26111
diff
changeset
|
2419 |
21409
2c40e60017a8
patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents:
21373
diff
changeset
|
2420 #ifdef FEAT_QUICKFIX |
26175
6b4f017d7005
patch 8.2.3619: cannot use a lambda for 'operatorfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26111
diff
changeset
|
2421 // 'quickfixtextfunc' |
21409
2c40e60017a8
patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents:
21373
diff
changeset
|
2422 else if (varp == &p_qftf) |
2c40e60017a8
patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents:
21373
diff
changeset
|
2423 { |
26175
6b4f017d7005
patch 8.2.3619: cannot use a lambda for 'operatorfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26111
diff
changeset
|
2424 if (qf_process_qftf_option() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2425 errmsg = e_invalid_argument; |
21409
2c40e60017a8
patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents:
21373
diff
changeset
|
2426 } |
2c40e60017a8
patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents:
21373
diff
changeset
|
2427 #endif |
2c40e60017a8
patch 8.2.1255: cannot use a lambda with quickfix functions
Bram Moolenaar <Bram@vim.org>
parents:
21373
diff
changeset
|
2428 |
26268
3aa48d4e3dc8
patch 8.2.3665: cannot use a lambda for 'tagfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26193
diff
changeset
|
2429 #ifdef FEAT_EVAL |
3aa48d4e3dc8
patch 8.2.3665: cannot use a lambda for 'tagfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26193
diff
changeset
|
2430 // 'tagfunc' |
3aa48d4e3dc8
patch 8.2.3665: cannot use a lambda for 'tagfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26193
diff
changeset
|
2431 else if (gvarp == &p_tfu) |
3aa48d4e3dc8
patch 8.2.3665: cannot use a lambda for 'tagfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26193
diff
changeset
|
2432 { |
3aa48d4e3dc8
patch 8.2.3665: cannot use a lambda for 'tagfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26193
diff
changeset
|
2433 if (set_tagfunc_option() == FAIL) |
26865
bce848ec8b1b
patch 8.2.3961: error messages are spread out
Bram Moolenaar <Bram@vim.org>
parents:
26759
diff
changeset
|
2434 errmsg = e_invalid_argument; |
26268
3aa48d4e3dc8
patch 8.2.3665: cannot use a lambda for 'tagfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26193
diff
changeset
|
2435 } |
3aa48d4e3dc8
patch 8.2.3665: cannot use a lambda for 'tagfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26193
diff
changeset
|
2436 #endif |
3aa48d4e3dc8
patch 8.2.3665: cannot use a lambda for 'tagfunc'
Bram Moolenaar <Bram@vim.org>
parents:
26193
diff
changeset
|
2437 |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2438 // Options that are a list of flags. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2439 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2440 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2441 p = NULL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2442 if (varp == &p_ww) // 'whichwrap' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2443 p = (char_u *)WW_ALL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2444 if (varp == &p_shm) // 'shortmess' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2445 p = (char_u *)SHM_ALL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2446 else if (varp == &(p_cpo)) // 'cpoptions' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2447 p = (char_u *)CPO_ALL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2448 else if (varp == &(curbuf->b_p_fo)) // 'formatoptions' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2449 p = (char_u *)FO_ALL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2450 #ifdef FEAT_CONCEAL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2451 else if (varp == &curwin->w_p_cocu) // 'concealcursor' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2452 p = (char_u *)COCU_ALL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2453 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2454 else if (varp == &p_mouse) // 'mouse' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2455 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2456 p = (char_u *)MOUSE_ALL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2457 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2458 #if defined(FEAT_GUI) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2459 else if (varp == &p_go) // 'guioptions' |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2460 p = (char_u *)GO_ALL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2461 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2462 if (p != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2463 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2464 for (s = *varp; *s; ++s) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2465 if (vim_strchr(p, *s) == NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2466 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2467 errmsg = illegal_char(errbuf, *s); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2468 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2469 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2470 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2471 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2472 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2473 // If error detected, restore the previous value. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2474 if (errmsg != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2475 { |
29509
d61007cc39b3
patch 9.0.0096: flag "new_value_alloced" is always true
Bram Moolenaar <Bram@vim.org>
parents:
29395
diff
changeset
|
2476 free_string_option(*varp); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2477 *varp = oldval; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2478 // When resetting some values, need to act on it. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2479 if (did_chartab) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2480 (void)init_chartab(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2481 if (varp == &p_hl) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2482 (void)highlight_changed(); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2483 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2484 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2485 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2486 #ifdef FEAT_EVAL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2487 // Remember where the option was set. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2488 set_option_sctx_idx(opt_idx, opt_flags, current_sctx); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2489 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2490 // Free string options that are in allocated memory. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2491 // Use "free_oldval", because recursiveness may change the flags under |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2492 // our fingers (esp. init_highlight()). |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2493 if (free_oldval) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2494 free_string_option(oldval); |
29509
d61007cc39b3
patch 9.0.0096: flag "new_value_alloced" is always true
Bram Moolenaar <Bram@vim.org>
parents:
29395
diff
changeset
|
2495 set_option_flag(opt_idx, P_ALLOCED); |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2496 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2497 if ((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2498 && is_global_local_option(opt_idx)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2499 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2500 // global option with local value set to use global value; free |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2501 // the local value and make it empty |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2502 p = get_option_varp_scope(opt_idx, OPT_LOCAL); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2503 free_string_option(*(char_u **)p); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2504 *(char_u **)p = empty_option; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2505 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2506 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2507 // May set global value for local option. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2508 else if (!(opt_flags & OPT_LOCAL) && opt_flags != OPT_GLOBAL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2509 set_string_option_global(opt_idx, varp); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2510 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2511 // Trigger the autocommand only after setting the flags. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2512 #ifdef FEAT_SYN_HL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2513 // When 'syntax' is set, load the syntax of that name |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2514 if (varp == &(curbuf->b_p_syn)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2515 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2516 static int syn_recursive = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2517 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2518 ++syn_recursive; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2519 // Only pass TRUE for "force" when the value changed or not used |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2520 // recursively, to avoid endless recurrence. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2521 apply_autocmds(EVENT_SYNTAX, curbuf->b_p_syn, curbuf->b_fname, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2522 value_changed || syn_recursive == 1, curbuf); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2523 curbuf->b_flags |= BF_SYN_SET; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2524 --syn_recursive; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2525 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2526 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2527 else if (varp == &(curbuf->b_p_ft)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2528 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2529 // 'filetype' is set, trigger the FileType autocommand. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2530 // Skip this when called from a modeline and the filetype was |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2531 // already set to this value. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2532 if (!(opt_flags & OPT_MODELINE) || value_changed) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2533 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2534 static int ft_recursive = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2535 int secure_save = secure; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2536 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2537 // Reset the secure flag, since the value of 'filetype' has |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2538 // been checked to be safe. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2539 secure = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2540 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2541 ++ft_recursive; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2542 did_filetype = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2543 // Only pass TRUE for "force" when the value changed or not |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2544 // used recursively, to avoid endless recurrence. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2545 apply_autocmds(EVENT_FILETYPE, curbuf->b_p_ft, curbuf->b_fname, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2546 value_changed || ft_recursive == 1, curbuf); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2547 --ft_recursive; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2548 // Just in case the old "curbuf" is now invalid. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2549 if (varp != &(curbuf->b_p_ft)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2550 varp = NULL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2551 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2552 secure = secure_save; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2553 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2554 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2555 #ifdef FEAT_SPELL |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2556 if (varp == &(curwin->w_s->b_p_spl)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2557 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2558 char_u fname[200]; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2559 char_u *q = curwin->w_s->b_p_spl; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2560 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2561 // Skip the first name if it is "cjk". |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2562 if (STRNCMP(q, "cjk,", 4) == 0) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2563 q += 4; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2564 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2565 // Source the spell/LANG.vim in 'runtimepath'. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2566 // They could set 'spellcapcheck' depending on the language. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2567 // Use the first name in 'spelllang' up to '_region' or |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2568 // '.encoding'. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2569 for (p = q; *p != NUL; ++p) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2570 if (!ASCII_ISALNUM(*p) && *p != '-') |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2571 break; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2572 if (p > q) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2573 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2574 vim_snprintf((char *)fname, 200, "spell/%.*s.vim", |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2575 (int)(p - q), q); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2576 source_runtime(fname, DIP_ALL); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2577 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2578 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2579 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2580 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2581 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2582 if (varp == &p_mouse) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2583 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2584 if (*p_mouse == NUL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2585 mch_setmouse(FALSE); // switch mouse off |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2586 else |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2587 setmouse(); // in case 'mouse' changed |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2588 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2589 |
20609
054ba681412d
patch 8.2.0858: not easy to require Lua modules
Bram Moolenaar <Bram@vim.org>
parents:
20415
diff
changeset
|
2590 #if defined(FEAT_LUA) || defined(PROTO) |
054ba681412d
patch 8.2.0858: not easy to require Lua modules
Bram Moolenaar <Bram@vim.org>
parents:
20415
diff
changeset
|
2591 if (varp == &p_rtp) |
054ba681412d
patch 8.2.0858: not easy to require Lua modules
Bram Moolenaar <Bram@vim.org>
parents:
20415
diff
changeset
|
2592 update_package_paths_in_lua(); |
054ba681412d
patch 8.2.0858: not easy to require Lua modules
Bram Moolenaar <Bram@vim.org>
parents:
20415
diff
changeset
|
2593 #endif |
054ba681412d
patch 8.2.0858: not easy to require Lua modules
Bram Moolenaar <Bram@vim.org>
parents:
20415
diff
changeset
|
2594 |
27000
8c0730eca2ce
patch 8.2.4029: debugging NFA regexp my crash, cached indent may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
26966
diff
changeset
|
2595 #if defined(FEAT_LINEBREAK) |
8c0730eca2ce
patch 8.2.4029: debugging NFA regexp my crash, cached indent may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
26966
diff
changeset
|
2596 // Changing Formatlistpattern when briopt includes the list setting: |
8c0730eca2ce
patch 8.2.4029: debugging NFA regexp my crash, cached indent may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
26966
diff
changeset
|
2597 // redraw |
8c0730eca2ce
patch 8.2.4029: debugging NFA regexp my crash, cached indent may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
26966
diff
changeset
|
2598 if ((varp == &p_flp || varp == &(curbuf->b_p_flp)) |
8c0730eca2ce
patch 8.2.4029: debugging NFA regexp my crash, cached indent may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
26966
diff
changeset
|
2599 && curwin->w_briopt_list) |
8c0730eca2ce
patch 8.2.4029: debugging NFA regexp my crash, cached indent may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
26966
diff
changeset
|
2600 redraw_all_later(NOT_VALID); |
8c0730eca2ce
patch 8.2.4029: debugging NFA regexp my crash, cached indent may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
26966
diff
changeset
|
2601 #endif |
8c0730eca2ce
patch 8.2.4029: debugging NFA regexp my crash, cached indent may be wrong
Bram Moolenaar <Bram@vim.org>
parents:
26966
diff
changeset
|
2602 |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2603 if (curwin->w_curswant != MAXCOL |
18354
9f51d0cef8da
patch 8.1.2171: mouse support not always available
Bram Moolenaar <Bram@vim.org>
parents:
18303
diff
changeset
|
2604 && (get_option_flags(opt_idx) & (P_CURSWANT | P_RALL)) != 0) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2605 curwin->w_set_curswant = TRUE; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2606 |
24079
a9ff8368d35f
patch 8.2.2581: Vim9: sourcing Vim9 script triggers a redraw
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
2607 if ((opt_flags & OPT_NO_REDRAW) == 0) |
a9ff8368d35f
patch 8.2.2581: Vim9: sourcing Vim9 script triggers a redraw
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
2608 { |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2609 #ifdef FEAT_GUI |
24079
a9ff8368d35f
patch 8.2.2581: Vim9: sourcing Vim9 script triggers a redraw
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
2610 // check redraw when it's not a GUI option or the GUI is active. |
a9ff8368d35f
patch 8.2.2581: Vim9: sourcing Vim9 script triggers a redraw
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
2611 if (!redraw_gui_only || gui.in_use) |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2612 #endif |
24079
a9ff8368d35f
patch 8.2.2581: Vim9: sourcing Vim9 script triggers a redraw
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
2613 check_redraw(get_option_flags(opt_idx)); |
a9ff8368d35f
patch 8.2.2581: Vim9: sourcing Vim9 script triggers a redraw
Bram Moolenaar <Bram@vim.org>
parents:
23952
diff
changeset
|
2614 } |
18100
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2615 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2616 #if defined(FEAT_VTP) && defined(FEAT_TERMGUICOLORS) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2617 if (did_swaptcap) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2618 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2619 set_termname((char_u *)"win32"); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2620 init_highlight(TRUE, FALSE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2621 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2622 #endif |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2623 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2624 return errmsg; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2625 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2626 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2627 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2628 * Check an option that can be a range of string values. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2629 * |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2630 * Return OK for correct value, FAIL otherwise. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2631 * Empty is always OK. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2632 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2633 static int |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2634 check_opt_strings( |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2635 char_u *val, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2636 char **values, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2637 int list) // when TRUE: accept a list of values |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2638 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2639 return opt_strings_flags(val, values, NULL, list); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2640 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2641 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2642 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2643 * Handle an option that can be a range of string values. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2644 * Set a flag in "*flagp" for each string present. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2645 * |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2646 * Return OK for correct value, FAIL otherwise. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2647 * Empty is always OK. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2648 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2649 static int |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2650 opt_strings_flags( |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2651 char_u *val, // new value |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2652 char **values, // array of valid string values |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2653 unsigned *flagp, |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2654 int list) // when TRUE: accept a list of values |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2655 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2656 int i; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2657 int len; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2658 unsigned new_flags = 0; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2659 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2660 while (*val) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2661 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2662 for (i = 0; ; ++i) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2663 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2664 if (values[i] == NULL) // val not found in values[] |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2665 return FAIL; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2666 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2667 len = (int)STRLEN(values[i]); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2668 if (STRNCMP(values[i], val, len) == 0 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2669 && ((list && val[len] == ',') || val[len] == NUL)) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2670 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2671 val += len + (val[len] == ','); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2672 new_flags |= (1 << i); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2673 break; // check next item in val list |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2674 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2675 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2676 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2677 if (flagp != NULL) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2678 *flagp = new_flags; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2679 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2680 return OK; |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2681 } |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2682 |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2683 /* |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2684 * return OK if "p" is a valid fileformat name, FAIL otherwise. |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2685 */ |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2686 int |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2687 check_ff_value(char_u *p) |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2688 { |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2689 return check_opt_strings(p, p_ff_values, FALSE); |
df5778d73320
patch 8.1.2045: the option.c file is too big
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2690 } |