Skip to content

Commit

Permalink
fixes #109, replace eval by str2nr
Browse files Browse the repository at this point in the history
  • Loading branch information
kassio committed Mar 25, 2014
1 parent bfb28e0 commit aaaaff9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugin/ack.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
" Location of the ack utility
if !exists("g:ackprg")
let s:ack_default_options = "-s -H --nocolor --nogroup --column"
if executable('ack-grep')
let g:ackprg = "ack-grep"
elseif executable('ack')
if executable('ack')
let g:ackprg = "ack"
elseif executable('ack-grep')
let g:ackprg = "ack-grep"
else
finish
endif
let g:ackprg .= s:ack_default_options
endif

let s:ackprg_version = eval(matchstr(system(g:ackprg . " --version"), '[0-9.]\+'))
let s:ackprg_version = str2nr(matchstr(system(g:ackprg . " --version"), '[0-9.]\+'))

if !exists("g:ack_apply_qmappings")
let g:ack_apply_qmappings = !exists("g:ack_qhandler")
Expand Down Expand Up @@ -64,7 +64,7 @@ function! s:Ack(cmd, args)
let grepformat_bak=&grepformat
try
let l:ackprg_run = g:ackprg
if a:cmd =~# '-g$' && s:ackprg_version > 2
if a:cmd =~# '-g$' && s:ackprg_version >= 2
" remove arguments that conflict with -g
let l:ackprg_run = substitute(l:ackprg_run, '-H\|--column', '', 'g')
end
Expand Down

0 comments on commit aaaaff9

Please sign in to comment.