aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_session.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_session.c')
-rw-r--r--src/nvim/ex_session.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c
index 9e4e69e124..67b8e7e92f 100644
--- a/src/nvim/ex_session.c
+++ b/src/nvim/ex_session.c
@@ -725,7 +725,7 @@ static int makeopens(FILE *fd, char_u *dirnow)
}
}
- if (tab_firstwin->w_next != NULL) {
+ if (tab_firstwin != NULL && tab_firstwin->w_next != NULL) {
// Go to the first window.
PUTLINE_FAIL("wincmd t");
@@ -835,7 +835,7 @@ static int makeopens(FILE *fd, char_u *dirnow)
p_shm) < 0) {
return FAIL;
}
- if (tab_firstwin->w_next != NULL) {
+ if (tab_firstwin != NULL && tab_firstwin->w_next != NULL) {
// Restore 'winminheight' and 'winminwidth'.
PUTLINE_FAIL("let &winminheight = s:save_winminheight");
PUTLINE_FAIL("let &winminwidth = s:save_winminwidth");
@@ -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;
}