aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/window.c
diff options
context:
space:
mode:
authorAlejandro Sanchez <asflin@gmx.de>2016-09-04 03:40:01 +0200
committerJustin M. Keyes <justinkz@gmail.com>2016-09-04 03:40:01 +0200
commit626065d385c4f7a06d2aa3dedf2fbb8fa68bfb48 (patch)
tree0afd43800543b80b1c2607e39c757855b4a78e6f /src/nvim/window.c
parent5d8d24f0c238a1ac8f7bf3a1e5d74447b8be36d0 (diff)
downloadrneovim-626065d385c4f7a06d2aa3dedf2fbb8fa68bfb48.tar.gz
rneovim-626065d385c4f7a06d2aa3dedf2fbb8fa68bfb48.tar.bz2
rneovim-626065d385c4f7a06d2aa3dedf2fbb8fa68bfb48.zip
tchdir: New tab should inherit CWD. (#5227)
When a new tabpage gets created it will copy the local working directory of the previous one, if there is any.
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r--src/nvim/window.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c
index ee99dd5d68..2e97cb2c3e 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -2978,6 +2978,9 @@ int win_new_tabpage(int after, char_u *filename)
xfree(newtp);
return FAIL;
}
+
+ newtp->localdir = tp->localdir ? vim_strsave(tp->localdir) : NULL;
+
curtab = newtp;
/* Create a new empty window. */