summaryrefslogtreecommitdiffstats
path: root/src/optionstr.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2023-09-20 20:20:04 +0200
committerChristian Brabandt <cb@256bit.org>2023-09-20 20:25:17 +0200
commit87018255e3ad0f4dfa03e20318836d24af721caf (patch)
tree132b551bd3ecddf43ae2d81ac23bfbbbe0e2177f /src/optionstr.c
parent98e68c07ce229148c994a42ead9f010b0d0a1be4 (diff)
patch 9.0.1921: not possible to use the jumplist like a stackv9.0.1921
Problem: not possible to use the jumplist like a stack Solution: Add the 'jumpoptions' setting to make the jumplist a stack. Add an option for using jumplist like tag stack related: #7738 closes: #13134 ported from NeoVim: - https://neovim.io/doc/user/motion.html#jumplist-stack - neovim/neovim@39094b3 - neovim/neovim#11530 - https://vi.stackexchange.com/questions/18344/how-to-change-jumplist-behavior Based on the feedback in the previous PR, it looks like many people like this option. Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com> Co-authored-by: butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com>
Diffstat (limited to 'src/optionstr.c')
-rw-r--r--src/optionstr.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/optionstr.c b/src/optionstr.c
index 31e30e195b..aeeab27891 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -35,6 +35,7 @@ static char *(p_cm_values[]) = {"zip", "blowfish", "blowfish2",
#endif
static char *(p_cmp_values[]) = {"internal", "keepascii", NULL};
static char *(p_dy_values[]) = {"lastline", "truncate", "uhex", NULL};
+static char *(p_jop_values[]) = {"stack", NULL};
#ifdef FEAT_FOLDING
static char *(p_fdo_values[]) = {"all", "block", "hor", "mark", "percent",
"quickfix", "search", "tag", "insert",
@@ -120,6 +121,7 @@ didset_string_options(void)
(void)opt_strings_flags(p_fdo, p_fdo_values, &fdo_flags, TRUE);
#endif
(void)opt_strings_flags(p_dy, p_dy_values, &dy_flags, TRUE);
+ (void)opt_strings_flags(p_jop, p_jop_values, &jop_flags, TRUE);
(void)opt_strings_flags(p_tc, p_tc_values, &tc_flags, FALSE);
(void)opt_strings_flags(p_ve, p_ve_values, &ve_flags, TRUE);
#if defined(UNIX) || defined(VMS)
@@ -1852,6 +1854,18 @@ did_set_isopt(optset_T *args)
return NULL;
}
+/*
+ * The 'jumpoptions' option is changed.
+ */
+ char *
+did_set_jumpoptions(optset_T *args)
+{
+ if (opt_strings_flags(p_jop, p_jop_values, &jop_flags, TRUE) != OK)
+ return e_invalid_argument;
+
+ return NULL;
+}
+
#if defined(FEAT_KEYMAP) || defined(PROTO)
/*
* The 'keymap' option is changed.