Skip to content

Commit e7f48a4

Browse files
committed
Shell escape PATH
References #202.
1 parent e9a7554 commit e7f48a4

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

ftplugin/ruby.vim

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ endif
6969

7070
function! s:query_path(root)
7171
let code = "print $:.join %q{,}"
72-
if &shell =~# 'sh' && $PATH !~# '\s'
73-
let prefix = 'env PATH='.$PATH.' '
72+
if &shell =~# 'sh'
73+
let prefix = 'env PATH='.shellescape($PATH).' '
7474
else
7575
let prefix = ''
7676
endif
@@ -190,15 +190,16 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
190190
endif
191191

192192
if maparg("\<C-]>",'n') == ''
193-
nnoremap <silent> <buffer> <C-]> :<C-U>exe v:count1."tag <C-R>=RubyCursorIdentifier()<CR>"<CR>
194-
nnoremap <silent> <buffer> g<C-]> :<C-U>exe "tjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
195-
nnoremap <silent> <buffer> g] :<C-U>exe "tselect <C-R>=RubyCursorIdentifier()<CR>"<CR>
196-
nnoremap <silent> <buffer> <C-W>] :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<CR>
197-
nnoremap <silent> <buffer> <C-W><C-]> :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<CR>
198-
nnoremap <silent> <buffer> <C-W>g<C-]> :<C-U>exe "stjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
199-
nnoremap <silent> <buffer> <C-W>g] :<C-U>exe "stselect <C-R>=RubyCursorIdentifier()<CR>"<CR>
200-
nnoremap <silent> <buffer> <C-W>} :<C-U>exe "ptag <C-R>=RubyCursorIdentifier()<CR>"<CR>
201-
nnoremap <silent> <buffer> <C-W>g} :<C-U>exe "ptjump <C-R>=RubyCursorIdentifier()<CR>"<CR>
193+
cnoremap <SID>foldopen <Bar>if &foldopen =~# 'tag'<Bar>foldopen<Bar>endif
194+
nnoremap <silent> <script> <buffer> <C-]> :<C-U>exe v:count1."tag <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
195+
nnoremap <silent> <script> <buffer> g<C-]> :<C-U>exe "tjump <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
196+
nnoremap <silent> <script> <buffer> g] :<C-U>exe "tselect <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
197+
nnoremap <silent> <script> <buffer> <C-W>] :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
198+
nnoremap <silent> <script> <buffer> <C-W><C-]> :<C-U>exe v:count1."stag <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
199+
nnoremap <silent> <script> <buffer> <C-W>g<C-]> :<C-U>exe "stjump <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
200+
nnoremap <silent> <script> <buffer> <C-W>g] :<C-U>exe "stselect <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
201+
nnoremap <silent> <script> <buffer> <C-W>} :<C-U>exe "ptag <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
202+
nnoremap <silent> <script> <buffer> <C-W>g} :<C-U>exe "ptjump <C-R>=RubyCursorIdentifier()<CR>"<SID>foldopen<CR>
202203
let b:undo_ftplugin = b:undo_ftplugin
203204
\."| sil! exe 'nunmap <buffer> <C-]>'| sil! exe 'nunmap <buffer> g<C-]>'| sil! exe 'nunmap <buffer> g]'"
204205
\."| sil! exe 'nunmap <buffer> <C-W>]'| sil! exe 'nunmap <buffer> <C-W><C-]>'"

0 commit comments

Comments
 (0)