mirror of
https://github.com/vim/vim.git
synced 2025-10-28 09:27:14 -04:00
patch 9.1.1605: cannot specify scope for chdir()
Problem: Cannot specify scope for chdir() Solution: Add optional scope argument (kuuote) closes: #17888 Signed-off-by: kuuote <znmxodq1@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
d82c918e2f
commit
8a65a49d50
@@ -96,10 +96,20 @@ func Test_chdir_func()
|
||||
call assert_equal('y', fnamemodify(getcwd(3, 2), ':t'))
|
||||
call assert_equal('testdir', fnamemodify(getcwd(1, 1), ':t'))
|
||||
|
||||
" Forcing scope
|
||||
call chdir('.', 'global')
|
||||
call assert_match('^\[global\]', trim(execute('verbose pwd')))
|
||||
call chdir('.', 'tabpage')
|
||||
call assert_match('^\[tabpage\]', trim(execute('verbose pwd')))
|
||||
call chdir('.', 'window')
|
||||
call assert_match('^\[window\]', trim(execute('verbose pwd')))
|
||||
|
||||
" Error case
|
||||
call assert_fails("call chdir('dir-abcd')", 'E344:')
|
||||
silent! let d = chdir("dir_abcd")
|
||||
call assert_equal("", d)
|
||||
call assert_fails("call chdir('.', test_null_string())", 'E475:')
|
||||
call assert_fails("call chdir('.', [])", 'E730:')
|
||||
" Should not crash
|
||||
call chdir(d)
|
||||
call assert_equal('', chdir([]))
|
||||
|
||||
@@ -770,6 +770,8 @@ enddef
|
||||
|
||||
def Test_chdir()
|
||||
assert_fails('chdir(true)', 'E1174:')
|
||||
assert_fails('chdir(".", test_null_string())', 'E475:')
|
||||
assert_fails('chdir(".", [])', 'E730:')
|
||||
enddef
|
||||
|
||||
def Test_cindent()
|
||||
|
||||
Reference in New Issue
Block a user