aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/cd_spec.lua
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 /test/functional/ex_cmds/cd_spec.lua
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 'test/functional/ex_cmds/cd_spec.lua')
-rw-r--r--test/functional/ex_cmds/cd_spec.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/ex_cmds/cd_spec.lua b/test/functional/ex_cmds/cd_spec.lua
index 3cf83cdb3b..74432dbe00 100644
--- a/test/functional/ex_cmds/cd_spec.lua
+++ b/test/functional/ex_cmds/cd_spec.lua
@@ -140,6 +140,27 @@ for _, cmd in ipairs {'cd', 'chdir'} do
end)
end)
+ describe('Local directory gets inherited', function()
+ it('by tabs', function()
+ local globalDir = directories.start
+
+ -- Create a new tab and change directory
+ execute('tabnew')
+ execute('silent t' .. cmd .. ' ' .. directories.tab)
+ eq(globalDir .. '/' .. directories.tab, tcwd())
+
+ -- Create a new tab and verify it has inherited the directory
+ execute('tabnew')
+ eq(globalDir .. '/' .. directories.tab, tcwd())
+
+ -- Change tab and change back, verify that directories are correct
+ execute('tabnext')
+ eq(globalDir, tcwd())
+ execute('tabprevious')
+ eq(globalDir .. '/' .. directories.tab, tcwd())
+ end)
+ end)
+
it('works', function()
local globalDir = directories.start
-- Create a new tab first and verify that is has the same working dir