Problem: Mkview always includes the local directory.
Solution: Add the "curdir" value in 'viewoptions'. (Eric Roberts, closes
#2316)
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|
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,
}
/*
- * 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
{"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}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1289,
/**/
1288,
/**/