mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-01-30 22:55:31 +08:00
Use -- before the search pattern for Ag, Rg, etc. (#1012)
Before this patch, a search pattern starting with a dash like `:Rg -bang` would fail (or exhibit the wrong behaviour) because it would be treated as a option. However, this case is very common when searching for ->member in a project in C, C++, PHP, etc. Co-authored-by: Alexandre Perrin <alex@atipik.ch>
This commit is contained in:
@@ -700,7 +700,7 @@ function! fzf#vim#ag(query, ...)
|
||||
let query = empty(a:query) ? '^(?=.)' : a:query
|
||||
let args = copy(a:000)
|
||||
let ag_opts = len(args) > 1 && type(args[0]) == s:TYPE.string ? remove(args, 0) : ''
|
||||
let command = ag_opts . ' ' . fzf#shellescape(query)
|
||||
let command = ag_opts . ' -- ' . fzf#shellescape(query)
|
||||
return call('fzf#vim#ag_raw', insert(args, command, 0))
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user