aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_quickfix.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-17 14:15:32 +0800
committerGitHub <noreply@github.com>2022-07-17 14:15:32 +0800
commit9e7f92e59a7fbbc0e266700db1f25278eb30cb2a (patch)
treee378e7e6d6ba2e4678d92b28c2a67f4930e5a607 /src/nvim/testdir/test_quickfix.vim
parent53c398d8f44f1796c216402c953512eb57733529 (diff)
parent006334f3a7014d5d23df617ed619377464d4956f (diff)
downloadrneovim-9e7f92e59a7fbbc0e266700db1f25278eb30cb2a.tar.gz
rneovim-9e7f92e59a7fbbc0e266700db1f25278eb30cb2a.tar.bz2
rneovim-9e7f92e59a7fbbc0e266700db1f25278eb30cb2a.zip
Merge pull request #19404 from zeertzjq/vim-8.2.0670
vim-patch:8.2.{0670,0698,1294,1984,2424,2426,2427,5029}: textlock patches
Diffstat (limited to 'src/nvim/testdir/test_quickfix.vim')
-rw-r--r--src/nvim/testdir/test_quickfix.vim84
1 files changed, 72 insertions, 12 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index af70b37163..ddd4229f17 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -3124,20 +3124,80 @@ func Test_file_from_copen()
endfunc
func Test_resize_from_copen()
+ augroup QF_Test
+ au!
+ au FileType qf resize 5
+ augroup END
+ try
+ " This should succeed without any exception. No other buffers are
+ " involved in the autocmd.
+ copen
+ finally
augroup QF_Test
- au!
- au FileType qf resize 5
+ au!
augroup END
- try
- " This should succeed without any exception. No other buffers are
- " involved in the autocmd.
- copen
- finally
- augroup QF_Test
- au!
- augroup END
- augroup! QF_Test
- endtry
+ augroup! QF_Test
+ endtry
+endfunc
+
+func Test_vimgrep_with_textlock()
+ new
+
+ " Simple way to execute something with "textlock" set.
+ " Check that vimgrep without jumping can be executed.
+ au InsertCharPre * vimgrep /RunTheTest/j runtest.vim
+ normal ax
+ let qflist = getqflist()
+ call assert_true(len(qflist) > 0)
+ call assert_match('RunTheTest', qflist[0].text)
+ call setqflist([], 'r')
+ au! InsertCharPre
+
+ " Check that vimgrepadd without jumping can be executed.
+ au InsertCharPre * vimgrepadd /RunTheTest/j runtest.vim
+ normal ax
+ let qflist = getqflist()
+ call assert_true(len(qflist) > 0)
+ call assert_match('RunTheTest', qflist[0].text)
+ call setqflist([], 'r')
+ au! InsertCharPre
+
+ " Check that lvimgrep without jumping can be executed.
+ au InsertCharPre * lvimgrep /RunTheTest/j runtest.vim
+ normal ax
+ let qflist = getloclist(0)
+ call assert_true(len(qflist) > 0)
+ call assert_match('RunTheTest', qflist[0].text)
+ call setloclist(0, [], 'r')
+ au! InsertCharPre
+
+ " Check that lvimgrepadd without jumping can be executed.
+ au InsertCharPre * lvimgrepadd /RunTheTest/j runtest.vim
+ normal ax
+ let qflist = getloclist(0)
+ call assert_true(len(qflist) > 0)
+ call assert_match('RunTheTest', qflist[0].text)
+ call setloclist(0, [], 'r')
+ au! InsertCharPre
+
+ " trying to jump will give an error
+ au InsertCharPre * vimgrep /RunTheTest/ runtest.vim
+ call assert_fails('normal ax', 'E565:')
+ au! InsertCharPre
+
+ au InsertCharPre * vimgrepadd /RunTheTest/ runtest.vim
+ call assert_fails('normal ax', 'E565:')
+ au! InsertCharPre
+
+ au InsertCharPre * lvimgrep /RunTheTest/ runtest.vim
+ call assert_fails('normal ax', 'E565:')
+ au! InsertCharPre
+
+ au InsertCharPre * lvimgrepadd /RunTheTest/ runtest.vim
+ call assert_fails('normal ax', 'E565:')
+ au! InsertCharPre
+
+ bwipe!
endfunc
" Tests for the quickfix buffer b:changedtick variable