Skip to content
This repository has been archived by the owner on Sep 21, 2019. It is now read-only.

Commit

Permalink
Add 'line_length_threshold' to ignore too long line in Gita grep
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdalisue committed Sep 5, 2016
1 parent ccfcbc6 commit 079ce2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions autoload/vital/__gita__/Git/Parser.vim
Expand Up @@ -510,13 +510,15 @@ function! s:parse_match_record(line, ...) abort
endfunction

function! s:parse_match(content, ...) abort
let options = get(a:000, 0, {})
let options = get(a:000, 0, {
\ 'line_length_threshold': 1000,
\})
let content = s:Prelude.is_string(a:content)
\ ? split(a:content, '\r\?\n', 1)
\ : a:content
let matches = []
for line in content
if empty(line)
if empty(line) || len(line) > options.line_length_threshold
continue
endif
let match = s:parse_match_record(line, options)
Expand Down

0 comments on commit 079ce2a

Please sign in to comment.