mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
DirChanged: support <buffer> (#8140)
This commit is contained in:
parent
0093c25dd3
commit
cca407b43e
@ -1560,7 +1560,7 @@ void do_autocmd_dirchanged(char *new_dir, CdScope scope)
|
||||
tv_dict_set_keys_readonly(dict);
|
||||
|
||||
apply_autocmds(EVENT_DIRCHANGED, (char_u *)buf, (char_u *)new_dir, false,
|
||||
NULL);
|
||||
curbuf);
|
||||
|
||||
tv_dict_clear(dict);
|
||||
|
||||
|
@ -154,4 +154,11 @@ describe('autocmd DirChanged', function()
|
||||
eq('Failed to change directory', string.match(err, ': (.*)'))
|
||||
eq({cwd=dirs[2], scope='global'}, eval('g:ev'))
|
||||
end)
|
||||
|
||||
it('works when local to buffer', function()
|
||||
command('let g:triggered = 0')
|
||||
command('autocmd DirChanged <buffer> let g:triggered = 1')
|
||||
command('cd '..dirs[1])
|
||||
eq(1, eval('g:triggered'))
|
||||
end)
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user