vim:plugins: Make Rg redefinition more robust
This commit is contained in:
@@ -33,10 +33,12 @@ endif
|
|||||||
|
|
||||||
if (get(g:, 'loaded_fzf'))
|
if (get(g:, 'loaded_fzf'))
|
||||||
" Redefine :Rg to ignore the .git directory
|
" Redefine :Rg to ignore the .git directory
|
||||||
let s:rg_desc = nvim_get_commands({})['Rg']
|
let s:rg_to_add = " -g '!.git' "
|
||||||
if s:rg_desc['definition'] !~ " -g '!.git' "
|
let s:rg_desc = get(nvim_get_commands({}), 'Rg', {})
|
||||||
|
|
||||||
|
if get(s:rg_desc, 'definition', s:rg_to_add) !~ s:rg_to_add
|
||||||
let s:rg_definition = substitute(s:rg_desc['definition'], ' -- ',
|
let s:rg_definition = substitute(s:rg_desc['definition'], ' -- ',
|
||||||
\ " -g '!.git' -- ", '')
|
\ s:rg_to_add .. '-- ', '')
|
||||||
" See :h command-attributes
|
" See :h command-attributes
|
||||||
" TODO: what is complete_arg?
|
" TODO: what is complete_arg?
|
||||||
let s:opts = filter(copy(s:rg_desc),
|
let s:opts = filter(copy(s:rg_desc),
|
||||||
|
|||||||
Reference in New Issue
Block a user