Skip to content

Commit

Permalink
Use fzf#shellescape instead (#1503)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiz4oh authored Sep 7, 2023
1 parent 7ba5be3 commit 587f55b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 303,7 @@ predefined `Ag` or `Rg` using `fzf#vim#grep`.
```vim
command! -bang -nargs=* GGrep
\ call fzf#vim#grep(
\ 'git grep --line-number -- '.shellescape(<q-args>),
\ 'git grep --line-number -- '.fzf#shellescape(<q-args>),
\ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0)
```

Expand Down
2 changes: 1 addition & 1 deletion autoload/fzf/vim.vim
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 914,7 @@ function! fzf#vim#grep2(command_prefix, query, ...)
\ 'source': ':',
\ 'options': ['--ansi', '--prompt', toupper(name).'> ', '--query', a:query,
\ '--disabled',
\ '--bind', 'start:reload:'.a:command_prefix.' '.shellescape(a:query),
\ '--bind', 'start:reload:'.a:command_prefix.' '.fzf#shellescape(a:query),
\ '--bind', 'change:reload:'.a:command_prefix.' {q} || :',
\ '--multi', '--bind', 'alt-a:select-all,alt-d:deselect-all',
\ '--delimiter', ':', '--preview-window', ' {2}-/2']
Expand Down
2 changes: 1 addition & 1 deletion autoload/fzf/vim/complete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 49,7 @@ endif
function! fzf#vim#complete#word(...)
let sources = empty(&dictionary) ? ['/usr/share/dict/words'] : split(&dictionary, ',')
return fzf#vim#complete(s:extend({
\ 'source': 'cat ' . join(map(sources, 'shellescape(v:val)'))},
\ 'source': 'cat ' . join(map(sources, 'fzf#shellescape(v:val)'))},
\ get(a:000, 0, fzf#wrap())))
endfunction

Expand Down
2 changes: 1 addition & 1 deletion doc/fzf-vim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 375,7 @@ predefined `Ag` or `Rg` using `fzf#vim#grep`.
>
command! -bang -nargs=* GGrep
\ call fzf#vim#grep(
\ 'git grep --line-number -- '.shellescape(<q-args>),
\ 'git grep --line-number -- '.fzf#shellescape(<q-args>),
\ fzf#vim#with_preview({'dir': systemlist('git rev-parse --show-toplevel')[0]}), <bang>0)
<
{11} bin/preview.sh
Expand Down
2 changes: 1 addition & 1 deletion plugin/fzf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 60,7 @@ call s:defs([
\'command! -bar -bang Colors call fzf#vim#colors(<bang>0)',
\'command! -bang -nargs= -complete=dir Locate call fzf#vim#locate(<q-args>, fzf#vim#with_preview(), <bang>0)',
\'command! -bang -nargs=* Ag call fzf#vim#ag(<q-args>, fzf#vim#with_preview(), <bang>0)',
\'command! -bang -nargs=* Rg call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case -- ".shellescape(<q-args>), fzf#vim#with_preview(), <bang>0)',
\'command! -bang -nargs=* Rg call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case -- ".fzf#shellescape(<q-args>), fzf#vim#with_preview(), <bang>0)',
\'command! -bang -nargs=* RG call fzf#vim#grep2("rg --column --line-number --no-heading --color=always --smart-case -- ", <q-args>, fzf#vim#with_preview(), <bang>0)',
\'command! -bang -nargs=* Tags call fzf#vim#tags(<q-args>, fzf#vim#with_preview({ "placeholder": "--tag {2}:{-1}:{3..}" }), <bang>0)',
\'command! -bang -nargs=* BTags call fzf#vim#buffer_tags(<q-args>, fzf#vim#with_preview({ "placeholder": "{2}:{3..}" }), <bang>0)',
Expand Down

0 comments on commit 587f55b

Please sign in to comment.