Skip to content

Commit fef8a23

Browse files
Add g:ctrlp_regex_always_higlight option
CtrlP highlights only path and files as you type pattern. Other extensions, such as 'lines' or 'tags' do not have highlighting as you type search pattern. With this patch other other extensions also can have pattern highlighting. For this, it is necessary to add: let g:ctrlp_regex_always_higlight = 1 This patch works only when: g:ctrlp_regexp = 1. Which is quite safe as universal approach. Signed-off-by: Andrei Stepanov <astepano@redhat.com>
1 parent 2868678 commit fef8a23

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

autoload/ctrlp.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,6 +1873,11 @@ fu! s:highlight(pat, grp)
18731873
en
18741874

18751875
cal matchadd('CtrlPLinePre', '^>')
1876+
elseif !empty(a:pat) && s:regexp &&
1877+
\ exists('g:ctrlp_regex_always_higlight') &&
1878+
\ g:ctrlp_regex_always_higlight
1879+
let pat = substitute(a:pat, '\\\@<!\^', '^> \\zs', 'g')
1880+
cal matchadd(a:grp, ( s:martcs == '' ? '\c' : '\C').pat)
18761881
en
18771882
endf
18781883

0 commit comments

Comments
 (0)