diff options
author | Eric Roberts <notthebmovieactor@gmail.com> | 2017-10-27 10:48:24 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-11-18 12:02:15 +0100 |
commit | a6de144c3e5cc888ab3cb7c2034a762b23566919 (patch) | |
tree | 7a6368c0786b50ace0953cfa1a1bdcf7a8f6be50 /src/nvim/ex_docmd.c | |
parent | f185c739bc843705bf46e844cb209b3f6b2de557 (diff) | |
download | rneovim-a6de144c3e5cc888ab3cb7c2034a762b23566919.tar.gz rneovim-a6de144c3e5cc888ab3cb7c2034a762b23566919.tar.bz2 rneovim-a6de144c3e5cc888ab3cb7c2034a762b23566919.zip |
'viewoptions': add "curdir" flag #7447
The flag enables the current local directory set by ":lcd" to be saved
to views which is the current default behaviour. The option can be
removed to disable this behaviour.
closes #7435
vim-patch:8.0.1289
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 7a2b0328df..5180420eff 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -9356,15 +9356,18 @@ put_view ( } } - /* - * Local directory. - */ - if (wp->w_localdir != NULL) { + // + // Local directory, if the current flag is not view options or the "curdir" + // option is included. + // + 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 - || put_eol(fd) == FAIL) + || put_eol(fd) == FAIL) { return FAIL; - did_lcd = TRUE; + } + did_lcd = true; } return OK; |