diff src/session.c @ 24464:a56f9c2ba51c v8.2.2772

patch 8.2.2772: problems when restoring 'runtimepath' from a session file Commit: https://github.com/vim/vim/commit/635bd60804966803490287e97460ecdc91d5fe0a Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 16 19:58:22 2021 +0200 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'.
author Bram Moolenaar <Bram@vim.org>
date Fri, 16 Apr 2021 20:00:05 +0200
parents 3b5d499c2bb5
children b2484fa6cb02
line wrap: on
line diff
--- a/src/session.c
+++ b/src/session.c
@@ -1225,8 +1225,16 @@ ex_mkrc(exarg_T	*eap)
 		|| (eap->cmdidx == CMD_mksession
 		    && (*flagp & SSOP_OPTIONS)))
 #endif
+	{
+	    int flags = OPT_GLOBAL;
+
+#ifdef FEAT_SESSION
+	    if (eap->cmdidx == CMD_mksession && (*flagp & SSOP_SKIP_RTP))
+		flags |= OPT_SKIPRTP;
+#endif
 	    failed |= (makemap(fd, NULL) == FAIL
-				   || makeset(fd, OPT_GLOBAL, FALSE) == FAIL);
+					 || makeset(fd, flags, FALSE) == FAIL);
+	}
 
 #ifdef FEAT_SESSION
 	if (!failed && view_session)