Skip to content

Commit adea3f0

Browse files
Andrei-Stepanovtimfeirg
authored andcommitted
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 239a709 commit adea3f0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

autoload/ctrlp.vim

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

18791879
cal matchadd('CtrlPLinePre', '^>')
1880+
elseif !empty(a:pat) && s:regexp &&
1881+
\ exists('g:ctrlp_regex_always_higlight') &&
1882+
\ g:ctrlp_regex_always_higlight
1883+
let pat = substitute(a:pat, '\\\@<!\^', '^> \\zs', 'g')
1884+
cal matchadd(a:grp, ( s:martcs == '' ? '\c' : '\C').pat)
18801885
en
18811886
endf
18821887

0 commit comments

Comments
 (0)