aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/optionstr.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-07-13 08:56:58 +0800
committerGitHub <noreply@github.com>2024-07-13 08:56:58 +0800
commitb1aa8f5eb8a5407e869335e9987b73f8515c37e5 (patch)
tree11d8e4909a8b191fbe627354fe68972102d6e467 /src/nvim/optionstr.c
parent10256bb760fcab0dc25f7eb5b0b45966cb771939 (diff)
downloadrneovim-b1aa8f5eb8a5407e869335e9987b73f8515c37e5.tar.gz
rneovim-b1aa8f5eb8a5407e869335e9987b73f8515c37e5.tar.bz2
rneovim-b1aa8f5eb8a5407e869335e9987b73f8515c37e5.zip
vim-patch:9.1.0572: cannot specify tab page closing behaviour (#29682)
Problem: cannot specify tab page closing behaviour (Gianluca Pacchiella) Solution: Add the 'tabclose' option (LemonBoy). fixes: vim/vim#5967 closes: vim/vim#15204 https://github.com/vim/vim/commit/5247b0b92e191a046b034171a3b34031e317735f Co-authored-by: LemonBoy <thatlemon@gmail.com>
Diffstat (limited to 'src/nvim/optionstr.c')
-rw-r--r--src/nvim/optionstr.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c
index 1a4c142fdd..8e853b6ee0 100644
--- a/src/nvim/optionstr.c
+++ b/src/nvim/optionstr.c
@@ -98,11 +98,13 @@ static char *(p_ssop_values[]) = { "buffers", "winpos", "resize", "winsize", "lo
"options", "help", "blank", "globals", "slash", "unix", "sesdir",
"curdir", "folds", "cursor", "tabpages", "terminal", "skiprtp",
NULL };
-// Keep in sync with SWB_ flags in option_defs.h
+// Keep in sync with SWB_ flags in option_vars.h
static char *(p_swb_values[]) = { "useopen", "usetab", "split", "newtab", "vsplit", "uselast",
NULL };
static char *(p_spk_values[]) = { "cursor", "screen", "topline", NULL };
static char *(p_tc_values[]) = { "followic", "ignore", "match", "followscs", "smart", NULL };
+// Keep in sync with TCL_ flags in option_vars.h
+static char *(p_tcl_values[]) = { "left", "uselast", NULL };
static char *(p_ve_values[]) = { "block", "insert", "all", "onemore", "none", "NONE", NULL };
// Note: Keep this in sync with check_opt_wim()
static char *(p_wim_values[]) = { "full", "longest", "list", "lastused", NULL };
@@ -169,6 +171,7 @@ void didset_string_options(void)
opt_strings_flags(p_tpf, p_tpf_values, &tpf_flags, true);
opt_strings_flags(p_ve, p_ve_values, &ve_flags, true);
opt_strings_flags(p_swb, p_swb_values, &swb_flags, true);
+ opt_strings_flags(p_tcl, p_tcl_values, &tcl_flags, true);
opt_strings_flags(p_wop, p_wop_values, &wop_flags, true);
opt_strings_flags(p_cb, p_cb_values, &cb_flags, true);
}
@@ -2207,6 +2210,21 @@ int expand_set_switchbuf(optexpand_T *args, int *numMatches, char ***matches)
matches);
}
+/// The 'tabclose' option is changed.
+const char *did_set_tabclose(optset_T *args FUNC_ATTR_UNUSED)
+{
+ return did_set_opt_flags(p_tcl, p_tcl_values, &tcl_flags, true);
+}
+
+int expand_set_tabclose(optexpand_T *args, int *numMatches, char ***matches)
+{
+ return expand_set_opt_string(args,
+ p_tcl_values,
+ ARRAY_SIZE(p_tcl_values) - 1,
+ numMatches,
+ matches);
+}
+
/// The 'tabline' option is changed.
const char *did_set_tabline(optset_T *args)
{