Skip to content

Commit 5b2cfef

Browse files
authored
Merge pull request #383 from Andrei-Stepanov/regex_hl
Add g:ctrlp_regex_always_higlight option
2 parents f74ef64 + fef8a23 commit 5b2cfef

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
@@ -1878,6 +1878,11 @@ fu! s:highlight(pat, grp)
18781878
en
18791879

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

0 commit comments

Comments
 (0)