diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-06-16 07:02:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-16 07:02:21 +0800 |
commit | ddba917efee26229d77f86d14a9f62dcfdc822b8 (patch) | |
tree | 700489889734974e098752a003e229ad41145853 /test | |
parent | 1f8fb7c00048bc217bb9a2bf29c58630d1810d6e (diff) | |
download | rneovim-ddba917efee26229d77f86d14a9f62dcfdc822b8.tar.gz rneovim-ddba917efee26229d77f86d14a9f62dcfdc822b8.tar.bz2 rneovim-ddba917efee26229d77f86d14a9f62dcfdc822b8.zip |
vim-patch:9.0.1636: expanding a pattern interferes with cmdline completion (#24034)
Problem: Expanding a pattern interferes with command line completion.
Solution: Set the file index only when appropriate. (closes vim/vim#12519)
https://github.com/vim/vim/commit/094dd152fe1d47878ec6c0b3f54b03ffde7f4a2d
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_cmdline.vim | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim index 96a30a1dd5..58d37b5da7 100644 --- a/test/old/testdir/test_cmdline.vim +++ b/test/old/testdir/test_cmdline.vim @@ -1251,6 +1251,30 @@ func Test_cmdline_complete_various() call assert_equal('"py3file', @:) endfunc +" Test that expanding a pattern doesn't interfere with cmdline completion. +func Test_expand_during_cmdline_completion() + func ExpandStuff() + badd <script>:p:h/README.* + call assert_equal(expand('<script>:p:h') .. '/README.txt', bufname('$')) + $bwipe + call assert_equal('README.txt', expand('README.*')) + call assert_equal(['README.txt'], getcompletion('README.*', 'file')) + endfunc + augroup test_CmdlineChanged + autocmd! + autocmd CmdlineChanged * call ExpandStuff() + augroup END + + call feedkeys(":sign \<Tab>\<Tab>\<Tab>\<Tab>\<C-B>\"\<CR>", 'xt') + call assert_equal('"sign place', @:) + + augroup test_CmdlineChanged + au! + augroup END + augroup! test_CmdlineChanged + delfunc ExpandStuff +endfunc + " Test for 'wildignorecase' func Test_cmdline_wildignorecase() CheckUnix @@ -1790,6 +1814,7 @@ func Test_cmd_bang_E135() augroup test_cmd_filter_E135 au! augroup END + augroup! test_cmd_filter_E135 %bwipe! endfunc @@ -2278,7 +2303,7 @@ endfunc func Test_cmd_map_cmdlineChanged() let g:log = [] cnoremap <F1> l<Cmd><CR>s - augroup test + augroup test_CmdlineChanged autocmd! autocmd CmdlineChanged : let g:log += [getcmdline()] augroup END @@ -2294,9 +2319,10 @@ func Test_cmd_map_cmdlineChanged() unlet g:log cunmap <F1> - augroup test + augroup test_CmdlineChanged autocmd! augroup END + augroup! test_CmdlineChanged endfunc " Test for the 'suffixes' option |