Skip to content

Commit 97978c2

Browse files
committed
Sanitize tool names for generated commands
Closes #148.
1 parent bb66c66 commit 97978c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugin/grepper.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,8 @@ endif
10841084
command! -nargs=* -complete=customlist,grepper#complete Grepper call <sid>parse_flags(<q-args>)
10851085

10861086
for s:tool in g:grepper.tools
1087-
let s:utool = toupper(s:tool[0]) . s:tool[1:]
1087+
let s:utool = substitute(toupper(s:tool[0]) . s:tool[1:], '-\(.\)',
1088+
\ '\=toupper(submatch(1))', 'g')
10881089
execute 'command! -nargs=+ -complete=file Grepper'. s:utool
10891090
\ 'Grepper -noprompt -tool' s:tool '-query <args>'
10901091
endfor

0 commit comments

Comments
 (0)