0
0
mirror of https://github.com/vim/vim.git synced 2025-11-15 23:14:06 -05:00
Files
vim/runtime/syntax/testdir/input/vim_ex_cd.vim
Doug Kearns f46616f0c4 runtime(vim): Update base syntax and generator, match :cd commands
Match :cd commands explicitly.

fixes: #17964
closes: #18736

Reported by Maxim Kim.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-11-15 10:17:17 +00:00

111 lines
2.0 KiB
VimL

" Vim :cd commands
" VIM_TEST_SETUP hi link vimCdArg Todo
cd
cd!
cd foo
cd! foo
cd %:h/foo
cd! %:h/foo
cd foo bar/baz
cd! foo bar/baz
cd -
cd! -
cd \"foo\"bar\"
cd \|foo\|bar\|
cd \#foo\#bar\#
cd \ foo\ bar\
cd \\foo\\bar\\
cd " comment
cd | echo "..."
cd! " comment
cd! | echo "..."
function Foo()
cd
cd!
cd foo
cd! foo
cd -
cd! -
cd " comment
cd | echo "..."
cd! " comment
cd! | echo "..."
endfunction
def Foo()
cd
cd!
cd foo
cd! foo
cd -
cd! -
cd # comment
cd | echo "..."
cd! # comment
cd! | echo "..."
enddef
cd | lcd | tcd | chdir | lchdir | tchdir | echo "..."
cd - | lcd - | tcd - | chdir - | lchdir - | tchdir - | echo "..."
cd foo | lcd foo | tcd foo | chdir foo | lchdir foo | tchdir foo | echo "..."
cd! | lcd! | tcd! | chdir! | lchdir! | tchdir! | echo "..."
cd! - | lcd! - | tcd! - | chdir! - | lchdir! - | tchdir! - | echo "..."
cd! foo | lcd! foo | tcd! foo | chdir! foo | lchdir! foo | tchdir! foo | echo "..."
cd " comment
cd! " comment
cd - " comment
cd! - " comment
cd foo " comment
cd! foo " comment
lcd " comment
lcd! " comment
lcd - " comment
lcd! - " comment
lcd foo " comment
lcd! foo " comment
tcd " comment
tcd! " comment
tcd - " comment
tcd! - " comment
tcd foo " comment
tcd! foo " comment
chdir " comment
chdir! " comment
chdir - " comment
chdir! - " comment
chdir foo " comment
chdir! foo " comment
lchdir " comment
lchdir! " comment
lchdir - " comment
lchdir! - " comment
lchdir foo " comment
lchdir! foo " comment
tchdir " comment
tchdir! " comment
tchdir - " comment
tchdir! - " comment
tchdir foo " comment
tchdir! foo " comment
" Issue #17964 (Vim script highlight: endif is not highlighted after lcd)
def LcdBack()
if get(g:, "lcd", 0)
g:lcd = 0
lcd -
endif
enddef