Skip to content

Commit 13e9041

Browse files
committed
patch 8.0.1289: mkview always includes the local directory
Problem: Mkview always includes the local directory. Solution: Add the "curdir" value in 'viewoptions'. (Eric Roberts, closes #2316)
1 parent ae147ab commit 13e9041

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

runtime/doc/options.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8387,7 +8387,7 @@ A jump table for the options with a short description can be found at |Q_op|.
83878387
security reasons.
83888388

83898389
*'viewoptions'* *'vop'*
8390-
'viewoptions' 'vop' string (default: "folds,options,cursor")
8390+
'viewoptions' 'vop' string (default: "folds,options,cursor,curdir")
83918391
global
83928392
{not in Vi}
83938393
{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|.
84058405
slashes
84068406
unix with Unix end-of-line format (single <NL>), even when
84078407
on Windows or DOS
8408+
curdir the window-local directory, if set with `:lcd`
84088409

84098410
"slash" and "unix" are useful on Windows when sharing view files
84108411
with Unix. The Unix version of Vim cannot source dos format scripts,

src/ex_docmd.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11695,9 +11695,11 @@ put_view(
1169511695
}
1169611696

1169711697
/*
11698-
* Local directory.
11698+
* Local directory, if the current flag is not view options or the "curdir"
11699+
* option is included.
1169911700
*/
11700-
if (wp->w_localdir != NULL)
11701+
if (wp->w_localdir != NULL
11702+
&& (flagp != &vop_flags || (*flagp & SSOP_CURDIR)))
1170111703
{
1170211704
if (fputs("lcd ", fd) < 0
1170311705
|| ses_put_fname(fd, wp->w_localdir, flagp) == FAIL

src/option.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2926,7 +2926,8 @@ static struct vimoption options[] =
29262926
{"viewoptions", "vop", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
29272927
#ifdef FEAT_SESSION
29282928
(char_u *)&p_vop, PV_NONE,
2929-
{(char_u *)"folds,options,cursor", (char_u *)0L}
2929+
{(char_u *)"folds,options,cursor,curdir",
2930+
(char_u *)0L}
29302931
#else
29312932
(char_u *)NULL, PV_NONE,
29322933
{(char_u *)0L, (char_u *)0L}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1289,
764766
/**/
765767
1288,
766768
/**/

0 commit comments

Comments
 (0)