aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-22 22:32:43 -0400
committerGitHub <noreply@github.com>2021-05-22 22:32:43 -0400
commit3fb3b548a6c2f88e1c0c3298589e153f45e199aa (patch)
treed0243b0e0a21550151510a30d0a4052c7f453af8 /src
parent0cbe748da34dbbd8c4db4914c9f87c500640c267 (diff)
parent59d550345d2531b1b1058a82ae4e4de6a941f8ad (diff)
downloadrneovim-3fb3b548a6c2f88e1c0c3298589e153f45e199aa.tar.gz
rneovim-3fb3b548a6c2f88e1c0c3298589e153f45e199aa.tar.bz2
rneovim-3fb3b548a6c2f88e1c0c3298589e153f45e199aa.zip
Merge pull request #14619 from janlazo/vim-8.2.2772
vim-patch:8.2.{2772,2778}
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_session.c13
-rw-r--r--src/nvim/option.c5
-rw-r--r--src/nvim/option.h3
-rw-r--r--src/nvim/option_defs.h7
4 files changed, 22 insertions, 6 deletions
diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c
index 9e4e69e124..c1e52d6994 100644
--- a/src/nvim/ex_session.c
+++ b/src/nvim/ex_session.c
@@ -937,11 +937,13 @@ void ex_mkrc(exarg_T *eap)
if (!view_session || (eap->cmdidx == CMD_mksession
&& (*flagp & SSOP_OPTIONS))) {
- failed |= (makemap(fd, NULL) == FAIL
- || makeset(fd, OPT_GLOBAL, false) == FAIL);
- if (p_hls && fprintf(fd, "%s", "set hlsearch\n") < 0) {
- failed = true;
+ int flags = OPT_GLOBAL;
+
+ if (eap->cmdidx == CMD_mksession && (*flagp & SSOP_SKIP_RTP)) {
+ flags |= OPT_SKIPRTP;
}
+ failed |= (makemap(fd, NULL) == FAIL
+ || makeset(fd, flags, false) == FAIL);
}
if (!failed && view_session) {
@@ -1002,6 +1004,9 @@ void ex_mkrc(exarg_T *eap)
< 0) {
failed = true;
}
+ if (p_hls && fprintf(fd, "%s", "set hlsearch\n") < 0) {
+ failed = true;
+ }
if (no_hlsearch && fprintf(fd, "%s", "nohlsearch\n") < 0) {
failed = true;
}
diff --git a/src/nvim/option.c b/src/nvim/option.c
index ad481af7fa..1454af1a73 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -5232,6 +5232,11 @@ int makeset(FILE *fd, int opt_flags, int local_only)
continue;
}
+ if ((opt_flags & OPT_SKIPRTP)
+ && (p->var == (char_u *)&p_rtp || p->var == (char_u *)&p_pp)) {
+ 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'