Merge PR #4994 'vim-patch:7.4.1716'

Fixes https://github.com/neovim/neovim/issues/4992
This commit is contained in:
Marco Hinz 2016-07-02 02:02:10 +02:00
commit c6eff87a25
3 changed files with 22 additions and 0 deletions

View File

@ -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;

View File

@ -86,6 +86,7 @@ static int included_patches[] = {
1755,
1753,
1728,
1716,
1695,
1654,
1652,

View File

@ -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)