Skip to content
Myr

[vim] Handle single/double quote characters in 'dir' option

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent c601fc6 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:plugin/fzf.vim+2 added-2 removed
78 unmodified lines
79 return '"'.substitute(a:arg, '"', '\\"', 'g').'"'80endfunction8182function! s:escape(path)83 return escape(a:path, ' %#\')83 return escape(a:path, ' %#''"\')84endfunction8586" Upgrade legacy options87function! s:upgrade(dict)
295 unmodified lines
383 let s:action = get(g:, 'fzf_action', s:default_action)384 let args = extend(['--expect='.join(keys(s:action), ',')], a:000)385 let opts = {}386 if len(args) > 0 && isdirectory(expand(args[-1]))387 let opts.dir = remove(args, -1)387 let opts.dir = substitute(remove(args, -1), '\\\(["'']\)', '\1', 'g')388 endif389 if !a:bang390 let opts.down = get(g:, 'fzf_height', get(g:, 'fzf_tmux_height', s:default_height))391 endif
8 unmodified lines