Permalink
Browse files

Fix for missing shellescape() in < 7.0.111

  • Loading branch information...
1 parent 5dfb7cc commit 44ecd8d315ef81bea3067e07421b9b984cb11f41 @majutsushi committed Oct 4, 2014
Showing with 13 additions and 2 deletions.
  1. +13 −2 autoload/tagbar.vim
View
@@ -2958,12 +2958,12 @@ function! s:EscapeCtagsCmd(ctags_bin, args, ...)
endif
if a:0 == 1
- let fname = shellescape(a:1)
+ let fname = s:shellescape(a:1)
else
let fname = ''
endif
- let ctags_cmd = shellescape(a:ctags_bin) . ' ' . a:args . ' ' . fname
+ let ctags_cmd = s:shellescape(a:ctags_bin) . ' ' . a:args . ' ' . fname
if exists('+shellslash')
let &shellslash = shellslash_save
@@ -3086,6 +3086,17 @@ function! s:CheckMouseClick()
endif
endfunction
+" s:shellescape() {{{2
+function! s:shellescape(s) abort
+ " shellescape() was added by patch 7.0.111
+ if exists('*shellescape')
+ return shellescape(a:s)
+ elseif has('win32') || has('win64')
+ return '"' . a:s . '"'
+ else
+ return "'" . a:s . '"'
+ endif
+endfunction
" TagbarBalloonExpr() {{{2
function! TagbarBalloonExpr()
let taginfo = s:GetTagInfo(v:beval_lnum, 1)

0 comments on commit 44ecd8d

Please sign in to comment.