diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2016-07-02 02:02:10 +0200 |
---|---|---|
committer | Marco Hinz <mh.codebro@gmail.com> | 2016-07-02 02:04:46 +0200 |
commit | c6eff87a25020032d089a0e40ae1a809d1b72bac (patch) | |
tree | 03ca3e56dd5c1a5b234a2e48d10fa9be32fbe6e7 | |
parent | 6f4f654231955bc655d0b8a92c21878429b8c446 (diff) | |
parent | 0d9593ff14a1d59b58816c830306daa1956d1220 (diff) | |
download | rneovim-c6eff87a25020032d089a0e40ae1a809d1b72bac.tar.gz rneovim-c6eff87a25020032d089a0e40ae1a809d1b72bac.tar.bz2 rneovim-c6eff87a25020032d089a0e40ae1a809d1b72bac.zip |
Merge PR #4994 'vim-patch:7.4.1716'
Fixes https://github.com/neovim/neovim/issues/4992
-rw-r--r-- | src/nvim/main.c | 3 | ||||
-rw-r--r-- | src/nvim/version.c | 1 | ||||
-rw-r--r-- | test/functional/options/autochdir_spec.lua | 18 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index ba545c0815..a876a0ad21 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -507,6 +507,9 @@ int main(int argc, char **argv) no_wait_return = FALSE; starting = 0; + // 'autochdir' has been postponed. + do_autochdir(); + /* start in insert mode */ if (p_im) need_start_insertmode = TRUE; diff --git a/src/nvim/version.c b/src/nvim/version.c index b2c6b332d1..aa3a34b3df 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -86,6 +86,7 @@ static int included_patches[] = { 1755, 1753, 1728, + 1716, 1695, 1654, 1652, diff --git a/test/functional/options/autochdir_spec.lua b/test/functional/options/autochdir_spec.lua new file mode 100644 index 0000000000..0e293761ad --- /dev/null +++ b/test/functional/options/autochdir_spec.lua @@ -0,0 +1,18 @@ +local helpers = require('test.functional.helpers')(after_each) +local clear = helpers.clear +local eq = helpers.eq +local getcwd = helpers.funcs.getcwd + +describe("'autochdir'", function() + it('given on the shell gets processed properly', function() + local targetdir = 'test/functional/fixtures' + + -- By default 'autochdir' is off, thus getcwd() returns the repo root. + clear(targetdir..'/tty-test.c') + local rootdir = getcwd() + + -- With 'autochdir' on, we should get the directory of tty-test.c. + clear('--cmd', 'set autochdir', targetdir..'/tty-test.c') + eq(rootdir..'/'..targetdir, getcwd()) + end) +end) |