]> granicus.if.org Git - vim/commitdiff
patch 8.2.2778: problem restoring 'packpath' in session v8.2.2778
authorBram Moolenaar <Bram@vim.org>
Sat, 17 Apr 2021 19:04:34 +0000 (21:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 17 Apr 2021 19:04:34 +0000 (21:04 +0200)
Problem:    Problem restoring 'packpath' in session.
Solution:   Let "skiprtp" also apply to 'packpath'.

runtime/doc/options.txt
src/option.c
src/testdir/test_mksession.vim
src/version.c

index 80bb235ae135452369042d5c333c249e5785f2fb..1f4c7e703ca00e06116c47a734960897569f03a1 100644 (file)
@@ -6511,7 +6511,7 @@ A jump table for the options with a short description can be found at |Q_op|.
                        global values for local options)
           options      all options and mappings (also global values for local
                        options)
-          skiprtp      exclude 'runtimepath' from the options
+          skiprtp      exclude 'runtimepath' and 'packpath' from the options
           resize       size of the Vim window: 'lines' and 'columns'
           sesdir       the directory in which the session file is located
                        will become the current directory (useful with
index d7997b0646eda52fe73f81ea4a64ac07cdbb0bf1..3c248c19319ffd07066b91e8d28669a6662eeb20 100644 (file)
@@ -4615,7 +4615,8 @@ makeset(FILE *fd, int opt_flags, int local_only)
            if ((opt_flags & OPT_GLOBAL) && optval_default(p, varp, p_cp))
                continue;
 
-           if ((opt_flags & OPT_SKIPRTP) && p->var == (char_u *)&p_rtp)
+           if ((opt_flags & OPT_SKIPRTP) && (p->var == (char_u *)&p_rtp
+                                                || p->var == (char_u *)&p_pp))
                continue;
 
            round = 2;
index 25c508102be33f3b05d0a745e0c192be0bcbb3ff..045aa2de0a5c03e07e5a2277fb100e486e998f34 100644 (file)
@@ -133,21 +133,25 @@ endfunc
 
 def Test_mksession_skiprtp()
   mksession! Xtest_mks.out
-  var found = 0
+  var found_rtp = 0
+  var found_pp = 0
   for line in readfile('Xtest_mks.out')
     if line =~ 'set runtimepath'
-      found = 1
-      break
+      found_rtp += 1
+    endif
+    if line =~ 'set packpath'
+      found_pp += 1
     endif
   endfor
-  assert_equal(1, found)
+  assert_equal(1, found_rtp)
+  assert_equal(1, found_pp)
   delete('Xtest_mks.out')
 
   set sessionoptions+=skiprtp
   mksession! Xtest_mks.out
-  found = 0
+  var found = 0
   for line in readfile('Xtest_mks.out')
-    if line =~ 'set runtimepath'
+    if line =~ 'set \(runtimepath\|packpath\)'
       found = 1
       break
     endif
index 17afa34a6a5614731c9cfe129a64d006b5db7fc0..83d7e572563904a1eda8ad0c582e02646896a4de 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2778,
 /**/
     2777,
 /**/