mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.1.0295: no 'incsearch' highlighting for :vimgrep and similar
Problem: No 'incsearch' highlighting for :vimgrep and similar commands. Solution: Parse the :vimgrep command and similar ones to locate the search pattern. (Hirohito Higashi, closes #3344)
This commit is contained in:
9
src/testdir/dumps/Test_incsearch_vimgrep_01.dump
Normal file
9
src/testdir/dumps/Test_incsearch_vimgrep_01.dump
Normal file
@@ -0,0 +1,9 @@
|
||||
|a+0&#ffffff0|n|o|t|h|e|r| |o+1&&|n|e+0&&| |2| @56
|
||||
|t|h|a|t| |o+0&#ffff4012|n|e+0&#ffffff0| |3| @59
|
||||
|t|h|e| |o+0&#ffff4012|n|e+0&#ffffff0| |1| @60
|
||||
|~+0#4040ff13&| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|:+0#0000000&|v|i|m|g|r|e|p| |o|n> @58
|
9
src/testdir/dumps/Test_incsearch_vimgrep_02.dump
Normal file
9
src/testdir/dumps/Test_incsearch_vimgrep_02.dump
Normal file
@@ -0,0 +1,9 @@
|
||||
|a+0&#ffffff0|n|o|t|h|e|r| |o+1&&|n|e+0&&| |2| @56
|
||||
|t|h|a|t| |o+0&#ffff4012|n|e+0&#ffffff0| |3| @59
|
||||
|t|h|e| |o+0&#ffff4012|n|e+0&#ffffff0| |1| @60
|
||||
|~+0#4040ff13&| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|:+0#0000000&|v|i|m|g| |/|o|n|/| |*|.|t|x|t> @53
|
9
src/testdir/dumps/Test_incsearch_vimgrep_03.dump
Normal file
9
src/testdir/dumps/Test_incsearch_vimgrep_03.dump
Normal file
@@ -0,0 +1,9 @@
|
||||
|a+0&#ffffff0|n|o|t|h|e|r| |o+1&&|n|e+0&&| |2| @56
|
||||
|t|h|a|t| |o+0&#ffff4012|n|e+0&#ffffff0| |3| @59
|
||||
|t|h|e| |o+0&#ffff4012|n|e+0&#ffffff0| |1| @60
|
||||
|~+0#4040ff13&| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|:+0#0000000&|v|i|m|g|r|e|p|a|d@1| |"|\|<|o|n> @52
|
9
src/testdir/dumps/Test_incsearch_vimgrep_04.dump
Normal file
9
src/testdir/dumps/Test_incsearch_vimgrep_04.dump
Normal file
@@ -0,0 +1,9 @@
|
||||
|a+0&#ffffff0|n|o|t|h|e|r| |o|n|e| |2| @56
|
||||
|t+1&&|h|a|t+0&&| |o|n|e| |3| @59
|
||||
|t|h|e| |o|n|e| |1| @60
|
||||
|~+0#4040ff13&| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|:+0#0000000&|l|v| |"|t|h|a> @61
|
9
src/testdir/dumps/Test_incsearch_vimgrep_05.dump
Normal file
9
src/testdir/dumps/Test_incsearch_vimgrep_05.dump
Normal file
@@ -0,0 +1,9 @@
|
||||
|a+0&#ffffff0|n|o|t+1&&|h|e|r+0&&| |o|n|e| |2| @56
|
||||
|t|h|a|t| |o|n|e| |3| @59
|
||||
|t+0&#ffff4012|h|e| +0&#ffffff0|o|n|e| |1| @60
|
||||
|~+0#4040ff13&| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|~| @68
|
||||
|:+0#0000000&|l|v|i|m|g|r|e|p|a| |"|t|h|e|"| |*@1|/|*|.|t|x|t> @44
|
@@ -944,6 +944,53 @@ func Test_incsearch_ssort_dump()
|
||||
call delete('Xis_sort_script')
|
||||
endfunc
|
||||
|
||||
" Similar to Test_incsearch_substitute_dump() for :vimgrep famiry
|
||||
func Test_incsearch_vimgrep_dump()
|
||||
if !exists('+incsearch')
|
||||
return
|
||||
endif
|
||||
if !CanRunVimInTerminal()
|
||||
return
|
||||
endif
|
||||
call writefile([
|
||||
\ 'set incsearch hlsearch scrolloff=0',
|
||||
\ 'call setline(1, ["another one 2", "that one 3", "the one 1"])',
|
||||
\ ], 'Xis_vimgrep_script')
|
||||
let buf = RunVimInTerminal('-S Xis_vimgrep_script', {'rows': 9, 'cols': 70})
|
||||
" Give Vim a chance to redraw to get rid of the spaces in line 2 caused by
|
||||
" the 'ambiwidth' check.
|
||||
sleep 100m
|
||||
|
||||
" Need to send one key at a time to force a redraw.
|
||||
call term_sendkeys(buf, ':vimgrep on')
|
||||
sleep 100m
|
||||
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_01', {})
|
||||
call term_sendkeys(buf, "\<Esc>")
|
||||
|
||||
call term_sendkeys(buf, ':vimg /on/ *.txt')
|
||||
sleep 100m
|
||||
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_02', {})
|
||||
call term_sendkeys(buf, "\<Esc>")
|
||||
|
||||
call term_sendkeys(buf, ':vimgrepadd "\<on')
|
||||
sleep 100m
|
||||
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_03', {})
|
||||
call term_sendkeys(buf, "\<Esc>")
|
||||
|
||||
call term_sendkeys(buf, ':lv "tha')
|
||||
sleep 100m
|
||||
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_04', {})
|
||||
call term_sendkeys(buf, "\<Esc>")
|
||||
|
||||
call term_sendkeys(buf, ':lvimgrepa "the" **/*.txt')
|
||||
sleep 100m
|
||||
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_05', {})
|
||||
call term_sendkeys(buf, "\<Esc>")
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
call delete('Xis_vimgrep_script')
|
||||
endfunc
|
||||
|
||||
func Test_search_undefined_behaviour()
|
||||
if !has("terminal")
|
||||
return
|
||||
|
Reference in New Issue
Block a user