diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/testdir/test_cd.vim | 9 | ||||
-rw-r--r-- | src/nvim/window.c | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cd.vim b/src/nvim/testdir/test_cd.vim index 36135b52ce..0bba321ee2 100644 --- a/src/nvim/testdir/test_cd.vim +++ b/src/nvim/testdir/test_cd.vim @@ -192,6 +192,15 @@ func Test_prev_dir() call delete('Xdir', 'rf') endfunc +func Test_lcd_split() + let curdir = getcwd() + lcd .. + split + lcd - + call assert_equal(curdir, getcwd()) + quit! +endfunc + func Test_cd_from_non_existing_dir() CheckNotMSWindows diff --git a/src/nvim/window.c b/src/nvim/window.c index db71512a3b..b841b219b2 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -1463,6 +1463,8 @@ static void win_init(win_T *newp, win_T *oldp, int flags) } newp->w_localdir = (oldp->w_localdir == NULL) ? NULL : vim_strsave(oldp->w_localdir); + newp->w_prevdir = (oldp->w_prevdir == NULL) + ? NULL : vim_strsave(oldp->w_prevdir); // copy tagstack and folds for (i = 0; i < oldp->w_tagstacklen; i++) { |