]> granicus.if.org Git - vim/commitdiff
patch 8.0.1289: mkview always includes the local directory v8.0.1289
authorBram Moolenaar <Bram@vim.org>
Sat, 11 Nov 2017 17:16:48 +0000 (18:16 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 11 Nov 2017 17:16:48 +0000 (18:16 +0100)
Problem:    Mkview always includes the local directory.
Solution:   Add the "curdir" value in 'viewoptions'. (Eric Roberts, closes
            #2316)

runtime/doc/options.txt
src/ex_docmd.c
src/option.c
src/version.c

index 28b545721af5ef7b0fc9cb1cfdf2f4cd104aa856..33dfea09ab1662947fead605ad4c01386b157551 100644 (file)
@@ -8387,7 +8387,7 @@ A jump table for the options with a short description can be found at |Q_op|.
        security reasons.
 
                                                *'viewoptions'* *'vop'*
-'viewoptions' 'vop'    string  (default: "folds,options,cursor")
+'viewoptions' 'vop'    string  (default: "folds,options,cursor,curdir")
                        global
                        {not in Vi}
                        {not available when compiled without the |+mksession|
@@ -8405,6 +8405,7 @@ A jump table for the options with a short description can be found at |Q_op|.
                        slashes
           unix         with Unix end-of-line format (single <NL>), even when
                        on Windows or DOS
+          curdir       the window-local directory, if set with `:lcd`
 
        "slash" and "unix" are useful on Windows when sharing view files
        with Unix.  The Unix version of Vim cannot source dos format scripts,
index 547d1acdbda4ba00148ec23cc0a2190398818eaa..84a72e112bbed23ddce5ed90d7edecf0f68bd88b 100644 (file)
@@ -11695,9 +11695,11 @@ put_view(
     }
 
     /*
-     * Local directory.
+     * Local directory, if the current flag is not view options or the "curdir"
+     * option is included.
      */
-    if (wp->w_localdir != NULL)
+    if (wp->w_localdir != NULL
+                           && (flagp != &vop_flags || (*flagp & SSOP_CURDIR)))
     {
        if (fputs("lcd ", fd) < 0
                || ses_put_fname(fd, wp->w_localdir, flagp) == FAIL
index ceafea389ed4b9ec7f6ef5126c2b5536440c8229..4f25c1ff4480e2d019b0fc7f3a9397d15519f4b4 100644 (file)
@@ -2926,7 +2926,8 @@ static struct vimoption options[] =
     {"viewoptions", "vop",  P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
 #ifdef FEAT_SESSION
                            (char_u *)&p_vop, PV_NONE,
-                           {(char_u *)"folds,options,cursor", (char_u *)0L}
+                           {(char_u *)"folds,options,cursor,curdir",
+                                                                 (char_u *)0L}
 #else
                            (char_u *)NULL, PV_NONE,
                            {(char_u *)0L, (char_u *)0L}
index ee1974541d375a802d28411251f59ca8c8c0ea47..41bfa749bb335606494280a8b3f60b503210bb17 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1289,
 /**/
     1288,
 /**/