aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-22 15:01:08 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-22 15:40:06 -0400
commit8415615b593c6673083a5004d5db9e8af4914726 (patch)
treee58158e11b6f33344aebf04c0b3b8a914b15b7c1 /src
parent8e5439182b0c62c433b0696d85e033ffc7404e0c (diff)
downloadrneovim-8415615b593c6673083a5004d5db9e8af4914726.tar.gz
rneovim-8415615b593c6673083a5004d5db9e8af4914726.tar.bz2
rneovim-8415615b593c6673083a5004d5db9e8af4914726.zip
vim-patch:8.2.2772: problems when restoring 'runtimepath' from a session file
Problem: Problems when restoring 'runtimepath' from a session file. Solution: Add the "skiprtp" item in 'sessionoptions'. https://github.com/vim/vim/commit/635bd60804966803490287e97460ecdc91d5fe0a Allow "terminal" value for sessionoptions even if it's no-opt because patch v8.0.1592 is not ported yet. Omit vim9 test, Test_mksession_skiprtp().
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_session.c7
-rw-r--r--src/nvim/option.c4
-rw-r--r--src/nvim/option.h3
-rw-r--r--src/nvim/option_defs.h7
4 files changed, 18 insertions, 3 deletions
diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c
index c22c1f428d..c1e52d6994 100644
--- a/src/nvim/ex_session.c
+++ b/src/nvim/ex_session.c
@@ -937,8 +937,13 @@ void ex_mkrc(exarg_T *eap)
if (!view_session || (eap->cmdidx == CMD_mksession
&& (*flagp & SSOP_OPTIONS))) {
+ int flags = OPT_GLOBAL;
+
+ if (eap->cmdidx == CMD_mksession && (*flagp & SSOP_SKIP_RTP)) {
+ flags |= OPT_SKIPRTP;
+ }
failed |= (makemap(fd, NULL) == FAIL
- || makeset(fd, OPT_GLOBAL, false) == FAIL);
+ || makeset(fd, flags, false) == FAIL);
}
if (!failed && view_session) {
diff --git a/src/nvim/option.c b/src/nvim/option.c
index ad481af7fa..b33571ccc2 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -5232,6 +5232,10 @@ int makeset(FILE *fd, int opt_flags, int local_only)
continue;
}
+ if ((opt_flags & OPT_SKIPRTP) && p->var == (char_u *)&p_rtp) {
+ continue;
+ }
+
round = 2;
if (p->indir != PV_NONE) {
if (p->var == VAR_WIN) {
diff --git a/src/nvim/option.h b/src/nvim/option.h
index 60f14dea44..c6ee03e052 100644
--- a/src/nvim/option.h
+++ b/src/nvim/option.h
@@ -19,6 +19,9 @@ typedef enum {
OPT_MODELINE = 8, ///< Option in modeline.
OPT_WINONLY = 16, ///< Only set window-local options.
OPT_NOWIN = 32, ///< Don’t set window-local options.
+ OPT_ONECOLUMN = 64, ///< list options one per line
+ OPT_NO_REDRAW = 128, ///< ignore redraw flags on option
+ OPT_SKIPRTP = 256, ///< "skiprtp" in 'sessionoptions'
} OptionFlags;
#ifdef INCLUDE_GENERATED_DECLARATIONS
diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h
index 62df28c55e..beb62a6a0b 100644
--- a/src/nvim/option_defs.h
+++ b/src/nvim/option_defs.h
@@ -572,11 +572,12 @@ EXTERN char_u *p_slm; // 'selectmode'
EXTERN char_u *p_ssop; // 'sessionoptions'
EXTERN unsigned ssop_flags;
# ifdef IN_OPTION_C
-// Also used for 'viewoptions'!
+// Also used for 'viewoptions'! Keep in sync with SSOP_ flags.
static char *(p_ssop_values[]) = {
"buffers", "winpos", "resize", "winsize",
"localoptions", "options", "help", "blank", "globals", "slash", "unix",
- "sesdir", "curdir", "folds", "cursor", "tabpages", NULL
+ "sesdir", "curdir", "folds", "cursor", "tabpages", "terminal", "skiprtp",
+ NULL
};
# endif
# define SSOP_BUFFERS 0x001
@@ -595,6 +596,8 @@ static char *(p_ssop_values[]) = {
# define SSOP_FOLDS 0x2000
# define SSOP_CURSOR 0x4000
# define SSOP_TABPAGES 0x8000
+# define SSOP_TERMINAL 0x10000
+# define SSOP_SKIP_RTP 0x20000
EXTERN char_u *p_sh; // 'shell'
EXTERN char_u *p_shcf; // 'shellcmdflag'