mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-02-27 12:02:27 +08:00
Fix fzf#vim#ag to allow optional fullscreen argument
This commit is contained in:
@@ -29,6 +29,7 @@ set cpo&vim
|
|||||||
" ------------------------------------------------------------------
|
" ------------------------------------------------------------------
|
||||||
|
|
||||||
let s:layout_keys = ['window', 'up', 'down', 'left', 'right']
|
let s:layout_keys = ['window', 'up', 'down', 'left', 'right']
|
||||||
|
let s:TYPE = {'dict': type({}), 'funcref': type(function('call')), 'string': type('')}
|
||||||
|
|
||||||
function s:remove_layout(opts)
|
function s:remove_layout(opts)
|
||||||
for key in s:layout_keys
|
for key in s:layout_keys
|
||||||
@@ -558,9 +559,12 @@ endfunction
|
|||||||
|
|
||||||
" query, [[ag options], options]
|
" query, [[ag options], options]
|
||||||
function! fzf#vim#ag(query, ...)
|
function! fzf#vim#ag(query, ...)
|
||||||
|
if type(a:query) != s:TYPE.string
|
||||||
|
return s:warn('Invalid query argument')
|
||||||
|
endif
|
||||||
let query = empty(a:query) ? '^(?=.)' : a:query
|
let query = empty(a:query) ? '^(?=.)' : a:query
|
||||||
let args = copy(a:000)
|
let args = copy(a:000)
|
||||||
let ag_opts = len(args) > 1 ? remove(args, 0) : ''
|
let ag_opts = len(args) > 1 && type(args[0]) == s:TYPE.string ? remove(args, 0) : ''
|
||||||
let command = ag_opts . ' ' . s:q1(query)
|
let command = ag_opts . ' ' . s:q1(query)
|
||||||
return call('fzf#vim#ag_raw', insert(args, command, 0))
|
return call('fzf#vim#ag_raw', insert(args, command, 0))
|
||||||
endfunction
|
endfunction
|
||||||
@@ -1106,8 +1110,6 @@ function! s:complete_insert(lines)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let s:TYPE = {'dict': type({}), 'funcref': type(function('call'))}
|
|
||||||
|
|
||||||
function! s:eval(dict, key, arg)
|
function! s:eval(dict, key, arg)
|
||||||
if has_key(a:dict, a:key) && type(a:dict[a:key]) == s:TYPE.funcref
|
if has_key(a:dict, a:key) && type(a:dict[a:key]) == s:TYPE.funcref
|
||||||
let ret = copy(a:dict)
|
let ret = copy(a:dict)
|
||||||
|
|||||||
Reference in New Issue
Block a user