Skip to content

Commit

Permalink
Highlight: handle .*? and .+?
Browse files Browse the repository at this point in the history
  • Loading branch information
mhinz committed Mar 24, 2016
1 parent 9c00c95 commit 57f7669
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions autoload/grepper.vim
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ function! s:highlight_query(flags)
else
" \bfoo\b -> \<foo\> Assume only one pair.
let vim_query = substitute(vim_query, '\v\\b(.{-})\\b', '\\<\1\\>', '')
" *? -> \{-}
let vim_query = substitute(vim_query, '*\\\=?', '\\{-}', 'g')
" +? -> \{-1,}
let vim_query = substitute(vim_query, '\\\=+\\\=?', '\\{-1,}', 'g')
let vim_query = escape(vim_query, '+')
endif

let @/ = vim_query
Expand Down

0 comments on commit 57f7669

Please sign in to comment.