From 5f996e36d102beeb76848021fe0ded5107c8f24d Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Sat, 13 Apr 2019 12:50:36 +0200 Subject: options: properly reset directories on 'autochdir' (#9894) Fixes https://github.com/neovim/neovim/issues/9892 --- test/functional/ex_cmds/cd_spec.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/functional') diff --git a/test/functional/ex_cmds/cd_spec.lua b/test/functional/ex_cmds/cd_spec.lua index bc2b365b30..283fcf9672 100644 --- a/test/functional/ex_cmds/cd_spec.lua +++ b/test/functional/ex_cmds/cd_spec.lua @@ -286,6 +286,15 @@ describe("getcwd()", function () command("call delete('../"..directories.global.."', 'd')") eq("", helpers.eval("getcwd()")) end) + + it("works with 'autochdir' after local directory was set (#9892)", function() + local curdir = cwd() + command('lcd ' .. directories.global) + command('lcd -') + command('set autochdir') + command('edit ' .. directories.global .. '/foo') + eq(curdir .. pathsep .. directories.global, cwd()) + end) end) -- cgit