From f25ebc229042d605cde1ba365883657fd0c0e693 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 15 Oct 2024 09:40:54 +0800 Subject: vim-patch:9.1.0783: 'spell' option setting has problems (#30818) Problem: 'spell' option setting has problems Solution: correctly check for comma for 'spellfile' option, remove unnecessary checks, refactor slightly (Milly) closes: vim/vim#15873 https://github.com/vim/vim/commit/322ad0c953b7a3023cd2a65db61d05e180a5d682 Co-authored-by: Milly --- src/nvim/optionstr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index c8f19d7ccf..1850b82209 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -2118,7 +2118,7 @@ const char *did_set_spellfile(optset_T *args) if ((!valid_spellfile(*varp))) { return e_invarg; } - return did_set_spell_option(true); + return did_set_spell_option(); } /// The 'spelllang' option is changed. @@ -2131,7 +2131,7 @@ const char *did_set_spelllang(optset_T *args) if (!valid_spelllang(*varp)) { return e_invarg; } - return did_set_spell_option(false); + return did_set_spell_option(); } /// The 'spelloptions' option is changed. -- cgit From 395f420fc65cb99f1c5cf17e230b962cb1e74bcd Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 18 Oct 2024 22:39:27 +0800 Subject: fix(options): fix some 'belloff' flags not working properly (#30856) Problem: Some 'belloff' flags don't work properly. Solution: Keep BO_ flags and p_bo_values[] in sync. --- src/nvim/optionstr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 1850b82209..082073148e 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -72,8 +72,8 @@ static char *(p_ambw_values[]) = { "single", "double", NULL }; static char *(p_bg_values[]) = { "light", "dark", NULL }; static char *(p_bkc_values[]) = { "yes", "auto", "no", "breaksymlink", "breakhardlink", NULL }; static char *(p_bo_values[]) = { "all", "backspace", "cursor", "complete", "copy", "ctrlg", "error", - "esc", "ex", "hangul", "lang", "mess", "showmatch", "operator", - "register", "shell", "spell", "wildmode", NULL }; + "esc", "ex", "hangul", "insertmode", "lang", "mess", "showmatch", + "operator", "register", "shell", "spell", "wildmode", NULL }; // Note: Keep this in sync with briopt_check() static char *(p_briopt_values[]) = { "shift:", "min:", "sbr", "list:", "column:", NULL }; // Note: Keep this in sync with diffopt_changed() -- cgit From 3cf602486ce5cfaa50f33edbe179928f84527dc9 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 20 Oct 2024 07:59:43 +0800 Subject: feat(terminal)!: make 'belloff' and 'visualbell' apply to terminal bell (#30859) vim-patch:8.2.4744: a terminal window can't use the bell vim-patch:8.2.4745: using wrong flag for using bell in the terminal BREAKING CHANGE: Bells from :terminal are now silent by default, unless 'belloff' option doesn't contain "term" or "all". --- src/nvim/optionstr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 082073148e..8e488d2539 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -73,7 +73,8 @@ static char *(p_bg_values[]) = { "light", "dark", NULL }; static char *(p_bkc_values[]) = { "yes", "auto", "no", "breaksymlink", "breakhardlink", NULL }; static char *(p_bo_values[]) = { "all", "backspace", "cursor", "complete", "copy", "ctrlg", "error", "esc", "ex", "hangul", "insertmode", "lang", "mess", "showmatch", - "operator", "register", "shell", "spell", "wildmode", NULL }; + "operator", "register", "shell", "spell", "term", "wildmode", + NULL }; // Note: Keep this in sync with briopt_check() static char *(p_briopt_values[]) = { "shift:", "min:", "sbr", "list:", "column:", NULL }; // Note: Keep this in sync with diffopt_changed() -- cgit From 1b9dafa67ba98e360444832e1fddce1e96acc1d6 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 22 Oct 2024 11:34:09 +0800 Subject: fix(options): fix :setglobal not working for 'spelloptions' (#30894) --- src/nvim/optionstr.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 8e488d2539..b560275de7 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -2116,7 +2116,7 @@ const char *did_set_spellfile(optset_T *args) // When there is a window for this buffer in which 'spell' // is set load the wordlists. - if ((!valid_spellfile(*varp))) { + if (!valid_spellfile(*varp)) { return e_invarg; } return did_set_spell_option(); @@ -2139,8 +2139,15 @@ const char *did_set_spelllang(optset_T *args) const char *did_set_spelloptions(optset_T *args) { win_T *win = (win_T *)args->os_win; - if (opt_strings_flags(win->w_s->b_p_spo, p_spo_values, &(win->w_s->b_p_spo_flags), - true) != OK) { + int opt_flags = args->os_flags; + const char *val = args->os_newval.string.data; + + if (!(opt_flags & OPT_LOCAL) + && opt_strings_flags(val, p_spo_values, &spo_flags, true) != OK) { + return e_invarg; + } + if (!(opt_flags & OPT_GLOBAL) + && opt_strings_flags(val, p_spo_values, &win->w_s->b_p_spo_flags, true) != OK) { return e_invarg; } return NULL; -- cgit From 6d2cf5ad3112d12b4b55df9df1e0921086b54fec Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 24 Oct 2024 06:04:13 +0800 Subject: vim-patch:9.1.0802: tests: no error check when setting global 'fdm' to empty value Problem: tests: no error check when setting global 'fdm' to empty value Solution: Also check global 'fdm' value for being empty (Milly). closes: vim/vim#15916 https://github.com/vim/vim/commit/142cad1f88d1d3aa34b6050151e620b66185112e Co-authored-by: Milly --- src/nvim/optionstr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index b560275de7..c801ec0a26 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -1448,8 +1448,7 @@ const char *did_set_foldmethod(optset_T *args) { win_T *win = (win_T *)args->os_win; char **varp = (char **)args->os_varp; - if (check_opt_strings(*varp, p_fdm_values, false) != OK - || *win->w_p_fdm == NUL) { + if (check_opt_strings(*varp, p_fdm_values, false) != OK || **varp == NUL) { return e_invarg; } foldUpdateAll(win); -- cgit From 3d2aca83de7f57ad0ba1c67acb87e55876569d0a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 24 Oct 2024 06:10:06 +0800 Subject: vim-patch:9.1.0803: tests: no error check when setting global 'isk' Problem: tests: no error check when setting global 'isk' Solution: also parse and check global 'isk' value (Milly) closes: vim/vim#15915 https://github.com/vim/vim/commit/5e7a6a4a106923e45c67dae6810e4c9753f88025 Co-authored-by: Milly --- src/nvim/optionstr.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index c801ec0a26..f9be1be3d2 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -1572,12 +1572,28 @@ int expand_set_inccommand(optexpand_T *args, int *numMatches, char ***matches) matches); } +/// The 'iskeyword' option is changed. +const char *did_set_iskeyword(optset_T *args) +{ + char **varp = (char **)args->os_varp; + + if (varp == &p_isk) { // only check for global-value + if (check_isopt(*varp) == FAIL) { + return e_invarg; + } + } else { // fallthrough for local-value + return did_set_isopt(args); + } + + return NULL; +} + /// The 'isident' or the 'iskeyword' or the 'isprint' or the 'isfname' option is /// changed. const char *did_set_isopt(optset_T *args) { buf_T *buf = (buf_T *)args->os_buf; - // 'isident', 'iskeyword', 'isprint or 'isfname' option: refill g_chartab[] + // 'isident', 'iskeyword', 'isprint' or 'isfname' option: refill g_chartab[] // If the new option is invalid, use old value. // 'lisp' option: refill g_chartab[] for '-' char if (buf_init_chartab(buf, true) == FAIL) { -- cgit From 5436d9b3c6c537b243ea6af4f1acc143bf94de1c Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 24 Oct 2024 06:23:00 +0800 Subject: vim-patch:9.1.0804: tests: no error check when setting global 'cc' Problem: tests: no error check when setting global 'cc' Solution: also parse and check global 'cc' value (Milly) closes: vim/vim#15914 https://github.com/vim/vim/commit/a441a3eaabbfc14b4772e07ecbecaaff3bd06a58 Co-authored-by: Milly --- src/nvim/optionstr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index f9be1be3d2..0e63a8089d 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -898,7 +898,8 @@ int expand_set_clipboard(optexpand_T *args, int *numMatches, char ***matches) const char *did_set_colorcolumn(optset_T *args) { win_T *win = (win_T *)args->os_win; - return check_colorcolumn(win); + char **varp = (char **)args->os_varp; + return check_colorcolumn(*varp, varp == &win->w_p_cc ? win : NULL); } /// The 'comments' option is changed. -- cgit From 6b63fe798b7481edd8e3b0ed75a33bf297ca2856 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 24 Oct 2024 06:31:09 +0800 Subject: vim-patch:9.1.0806: tests: no error check when setting global 'briopt' Problem: tests: no error check when setting global 'briopt' Solution: also parse and check global 'briopt' value (Milly) closes: vim/vim#15911 https://github.com/vim/vim/commit/b38700ac81d90a652e5c8495056dd78df5babdde Co-authored-by: Milly --- src/nvim/optionstr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 0e63a8089d..23b70ab5ad 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -717,11 +717,14 @@ const char *did_set_breakat(optset_T *args FUNC_ATTR_UNUSED) const char *did_set_breakindentopt(optset_T *args) { win_T *win = (win_T *)args->os_win; - if (briopt_check(win) == FAIL) { + char **varp = (char **)args->os_varp; + + if (briopt_check(*varp, varp == &win->w_p_briopt ? win : NULL) == FAIL) { return e_invarg; } + // list setting requires a redraw - if (win == curwin && win->w_briopt_list) { + if (varp == &win->w_p_briopt && win->w_briopt_list) { redraw_all_later(UPD_NOT_VALID); } -- cgit From 50e63c8171d47157cfad5c1b8f1958a4a7e9d9c7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 24 Oct 2024 10:03:38 +0800 Subject: fix(options): missing error check for global 'scl' and 'winhl' (#30919) --- src/nvim/optionstr.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 23b70ab5ad..21a3a3877b 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -283,15 +283,27 @@ static bool valid_filetype(const char *val) /// Handle setting 'signcolumn' for value 'val'. Store minimum and maximum width. /// +/// @param wcl when NULL: use "wp->w_p_scl" +/// @param wp when NULL: only parse "scl" +/// /// @return OK when the value is valid, FAIL otherwise -int check_signcolumn(win_T *wp) +int check_signcolumn(char *scl, win_T *wp) { - char *val = wp->w_p_scl; + char *val = empty_string_option; + if (scl != NULL) { + val = scl; + } else if (wp != NULL) { + val = wp->w_p_scl; + } + if (*val == NUL) { return FAIL; } if (check_opt_strings(val, p_scl_values, false) == OK) { + if (wp == NULL) { + return OK; + } if (!strncmp(val, "no", 2)) { // no wp->w_minscwidth = wp->w_maxscwidth = SCL_NO; } else if (!strncmp(val, "nu", 2) && (wp->w_p_nu || wp->w_p_rnu)) { // number @@ -321,6 +333,9 @@ int check_signcolumn(win_T *wp) if (min < 1 || max < 2 || min > 8 || min >= max) { return FAIL; } + if (wp == NULL) { + return OK; + } wp->w_minscwidth = min; wp->w_maxscwidth = max; } @@ -2099,8 +2114,9 @@ int expand_set_showcmdloc(optexpand_T *args, int *numMatches, char ***matches) const char *did_set_signcolumn(optset_T *args) { win_T *win = (win_T *)args->os_win; + char **varp = (char **)args->os_varp; const char *oldval = args->os_oldval.string.data; - if (check_signcolumn(win) != OK) { + if (check_signcolumn(*varp, varp == &win->w_p_scl ? win : NULL) != OK) { return e_invarg; } // When changing the 'signcolumn' to or from 'number', recompute the @@ -2568,7 +2584,8 @@ const char *did_set_winbar(optset_T *args) const char *did_set_winhighlight(optset_T *args) { win_T *win = (win_T *)args->os_win; - if (!parse_winhl_opt(win)) { + char **varp = (char **)args->os_varp; + if (!parse_winhl_opt(*varp, varp == &win->w_p_winhl ? win : NULL)) { return e_invarg; } return NULL; -- cgit From b136a9ee4c5689c655713ab006be84ae9e7a313a Mon Sep 17 00:00:00 2001 From: Famiu Haque Date: Sun, 27 Oct 2024 19:09:24 +0600 Subject: refactor(options): always allocate option values (#30917) Instead of keeping `P_ALLOCED` and `P_DEF_ALLOCED` flags to check if an option value is allocated, always allocate option values to simplify the logic. Ref: #25672 --- src/nvim/optionstr.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 21a3a3877b..651a9d20bf 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -250,7 +250,6 @@ void check_buf_options(buf_T *buf) /// Free the string allocated for an option. /// Checks for the string being empty_string_option. This may happen if we're out of memory, /// xstrdup() returned NULL, which was replaced by empty_string_option by check_options(). -/// Does NOT check for P_ALLOCED flag! void free_string_option(char *p) { if (p != empty_string_option) { -- cgit From 34c44c355646311aa67fe53e1e5ce040789430c6 Mon Sep 17 00:00:00 2001 From: Famiu Haque Date: Mon, 28 Oct 2024 19:49:16 +0600 Subject: refactor(options): option flags enum #30961 Problem: Currently we use macros with hardcoded flag values for option flags, which is messy and requires a lot of mental math for adding / removing option flags. Using macros for option flags also means that they cannot be used inside debuggers. Solution: Create a new `OptFlags` enum that stores all the option flags in an organized way that is easier to understand. --- src/nvim/optionstr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 651a9d20bf..e07fcf2f0e 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -419,9 +419,9 @@ const char *check_stl_option(char *s) /// often illegal in a file name. Be more permissive if "secure" is off. bool check_illegal_path_names(char *val, uint32_t flags) { - return (((flags & P_NFNAME) + return (((flags & kOptFlagNFname) && strpbrk(val, (secure ? "/\\*?[|;&<>\r\n" : "/\\*?[<>\r\n")) != NULL) - || ((flags & P_NDNAME) + || ((flags & kOptFlagNDname) && strpbrk(val, "*?[|;&<>\r\n") != NULL)); } @@ -1377,7 +1377,7 @@ const char *did_set_filetype_or_syntax(optset_T *args) args->os_value_changed = strcmp(args->os_oldval.string.data, *varp) != 0; - // Since we check the value, there is no need to set P_INSECURE, + // Since we check the value, there is no need to set kOptFlagInsecure, // even when the value comes from a modeline. args->os_value_checked = true; @@ -1658,7 +1658,7 @@ const char *did_set_keymap(optset_T *args) secure = secure_save; - // Since we check the value, there is no need to set P_INSECURE, + // Since we check the value, there is no need to set kOptFlagInsecure, // even when the value comes from a modeline. args->os_value_checked = true; -- cgit From 378d9135e7ac0f91a4944be816dc9f693d5078af Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 28 Oct 2024 15:14:15 +0800 Subject: vim-patch:9.1.0810: cannot easily adjust the |:find| command Problem: cannot easily adjust the |:find| command Solution: Add support for the 'findexpr' option (Yegappan Lakshmanan) closes: vim/vim#15901 closes: vim/vim#15905 https://github.com/vim/vim/commit/aeb1c97db5b9de4f4903e7f288f2aa5ad6c49440 Co-authored-by: Yegappan Lakshmanan --- src/nvim/optionstr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index e07fcf2f0e..c66849800c 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -233,6 +233,7 @@ void check_buf_options(buf_T *buf) check_string_option(&buf->b_p_mp); check_string_option(&buf->b_p_efm); check_string_option(&buf->b_p_ep); + check_string_option(&buf->b_p_fexpr); check_string_option(&buf->b_p_path); check_string_option(&buf->b_p_tags); check_string_option(&buf->b_p_tfu); @@ -1885,8 +1886,9 @@ int expand_set_nrformats(optexpand_T *args, int *numMatches, char ***matches) matches); } -/// One of the '*expr' options is changed:, 'diffexpr', 'foldexpr', 'foldtext', -/// 'formatexpr', 'includeexpr', 'indentexpr', 'patchexpr' and 'charconvert'. +/// One of the '*expr' options is changed:, 'diffexpr', 'findexpr', +/// 'foldexpr', 'foldtext', 'formatexpr', 'includeexpr', 'indentexpr', +/// 'patchexpr' and 'charconvert'. const char *did_set_optexpr(optset_T *args) { char **varp = (char **)args->os_varp; -- cgit From 3075c69ff02faf396e5efbdcb4a255b0b0309649 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 3 Nov 2024 10:06:41 +0800 Subject: vim-patch:9.1.0831: 'findexpr' can't be used as lambad or Funcref (#31058) Problem: 'findexpr' can't be used for lambads (Justin Keyes) Solution: Replace the findexpr option with the findfunc option (Yegappan Lakshmanan) related: vim/vim#15905 closes: vim/vim#15976 https://github.com/vim/vim/commit/a13f3a4f5de9c150f70298850e34747838904995 Co-authored-by: Yegappan Lakshmanan --- src/nvim/optionstr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index c66849800c..307c4ae79f 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -233,9 +233,9 @@ void check_buf_options(buf_T *buf) check_string_option(&buf->b_p_mp); check_string_option(&buf->b_p_efm); check_string_option(&buf->b_p_ep); - check_string_option(&buf->b_p_fexpr); check_string_option(&buf->b_p_path); check_string_option(&buf->b_p_tags); + check_string_option(&buf->b_p_ffu); check_string_option(&buf->b_p_tfu); check_string_option(&buf->b_p_tc); check_string_option(&buf->b_p_dict); @@ -1886,9 +1886,8 @@ int expand_set_nrformats(optexpand_T *args, int *numMatches, char ***matches) matches); } -/// One of the '*expr' options is changed:, 'diffexpr', 'findexpr', -/// 'foldexpr', 'foldtext', 'formatexpr', 'includeexpr', 'indentexpr', -/// 'patchexpr' and 'charconvert'. +/// One of the '*expr' options is changed:, 'diffexpr', 'foldexpr', 'foldtext', +/// 'formatexpr', 'includeexpr', 'indentexpr', 'patchexpr' and 'charconvert'. const char *did_set_optexpr(optset_T *args) { char **varp = (char **)args->os_varp; -- cgit From 981fa11c91d3655828b4f70ccf7d079d917d5b6b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 3 Nov 2024 16:52:20 +0800 Subject: vim-patch:9.1.0832: :set doesn't work for 'cot' and 'bkc' after :setlocal Problem: :set doesn't work for 'cot' and 'bkc' after :setlocal. Solution: clear the local flags when using :set (zeertzjq). closes: vim/vim#15981 https://github.com/vim/vim/commit/46dcd84d242db6b053cb5b777c896cede9ad9b27 --- src/nvim/optionstr.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 307c4ae79f..48423a1779 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -655,6 +655,9 @@ const char *did_set_backupcopy(optset_T *args) if (opt_flags & OPT_LOCAL) { bkc = buf->b_p_bkc; flags = &buf->b_bkc_flags; + } else if (!(opt_flags & OPT_GLOBAL)) { + // When using :set, clear the local flags. + buf->b_bkc_flags = 0; } if ((opt_flags & OPT_LOCAL) && *bkc == NUL) { @@ -1070,6 +1073,9 @@ const char *did_set_completeopt(optset_T *args FUNC_ATTR_UNUSED) if (args->os_flags & OPT_LOCAL) { cot = buf->b_p_cot; flags = &buf->b_cot_flags; + } else if (!(args->os_flags & OPT_GLOBAL)) { + // When using :set, clear the local flags. + buf->b_cot_flags = 0; } if (check_opt_strings(cot, p_cot_values, true) != OK) { -- cgit From cbc9a03f58394bbb85bbe70c48856cc1efca4ab7 Mon Sep 17 00:00:00 2001 From: Famiu Haque Date: Sun, 3 Nov 2024 16:36:26 +0600 Subject: refactor(options): remove fileformat macros --- src/nvim/optionstr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 48423a1779..af2b09513b 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -84,7 +84,7 @@ static char *(p_dip_values[]) = { "filler", "context:", "iblank", "icase", "indent-heuristic", "linematch:", "algorithm:", NULL }; static char *(p_dip_algorithm_values[]) = { "myers", "minimal", "patience", "histogram", NULL }; static char *(p_nf_values[]) = { "bin", "octal", "hex", "alpha", "unsigned", "blank", NULL }; -static char *(p_ff_values[]) = { FF_UNIX, FF_DOS, FF_MAC, NULL }; +static char *(p_ff_values[]) = { "unix", "dos", "mac", NULL }; static char *(p_cb_values[]) = { "unnamed", "unnamedplus", NULL }; static char *(p_cmp_values[]) = { "internal", "keepascii", NULL }; // Note: Keep this in sync with fill_culopt_flags() -- cgit From f83a31b49d5d976cd39f7faa6356565cb0a4a97a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 8 Nov 2024 14:54:28 +0800 Subject: refactor(options): use os_win/os_buf for local options (#31060) Conversely, don't use them for global options. --- src/nvim/optionstr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/optionstr.c') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index af2b09513b..bfb26a0be6 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -892,10 +892,11 @@ int expand_set_chars_option(optexpand_T *args, int *numMatches, char ***matches) } /// The 'cinoptions' option is changed. -const char *did_set_cinoptions(optset_T *args FUNC_ATTR_UNUSED) +const char *did_set_cinoptions(optset_T *args) { + buf_T *buf = (buf_T *)args->os_buf; // TODO(vim): recognize errors - parse_cino(curbuf); + parse_cino(buf); return NULL; } -- cgit