mirror of
https://github.com/neovim/neovim.git
synced 2025-11-08 11:35:10 +00:00
Merge PR #4994 'vim-patch:7.4.1716'
Fixes https://github.com/neovim/neovim/issues/4992
This commit is contained in:
@@ -507,6 +507,9 @@ int main(int argc, char **argv)
|
|||||||
no_wait_return = FALSE;
|
no_wait_return = FALSE;
|
||||||
starting = 0;
|
starting = 0;
|
||||||
|
|
||||||
|
// 'autochdir' has been postponed.
|
||||||
|
do_autochdir();
|
||||||
|
|
||||||
/* start in insert mode */
|
/* start in insert mode */
|
||||||
if (p_im)
|
if (p_im)
|
||||||
need_start_insertmode = TRUE;
|
need_start_insertmode = TRUE;
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ static int included_patches[] = {
|
|||||||
1755,
|
1755,
|
||||||
1753,
|
1753,
|
||||||
1728,
|
1728,
|
||||||
|
1716,
|
||||||
1695,
|
1695,
|
||||||
1654,
|
1654,
|
||||||
1652,
|
1652,
|
||||||
|
|||||||
18
test/functional/options/autochdir_spec.lua
Normal file
18
test/functional/options/autochdir_spec.lua
Normal 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)
|
||||||
Reference in New Issue
Block a user