mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-23 01:09:56 +08:00
Some fixes for FlyGrep (#3908)
This commit is contained in:
parent
105ba4edb1
commit
3c795e6d42
@ -38,7 +38,12 @@ main () {
|
|||||||
_detect autoload/SpaceVim/api/vim/buffer.vim
|
_detect autoload/SpaceVim/api/vim/buffer.vim
|
||||||
_detect autoload/SpaceVim/api/vim/regex.vim
|
_detect autoload/SpaceVim/api/vim/regex.vim
|
||||||
_detect autoload/SpaceVim/api/vim/compatible.vim
|
_detect autoload/SpaceVim/api/vim/compatible.vim
|
||||||
|
_detect autoload/SpaceVim/api/vim/floating.vim
|
||||||
|
_detect autoload/SpaceVim/api/vim/highlight.vim
|
||||||
|
_detect autoload/SpaceVim/api/vim/statusline.vim
|
||||||
|
_detect autoload/SpaceVim/api/vim/window.vim
|
||||||
_detect autoload/SpaceVim/api/neovim/floating.vim
|
_detect autoload/SpaceVim/api/neovim/floating.vim
|
||||||
|
_detect autoload/SpaceVim/api/data/dict.vim
|
||||||
_detect autoload/SpaceVim/api/data/list.vim
|
_detect autoload/SpaceVim/api/data/list.vim
|
||||||
_detect autoload/SpaceVim/api/data/json.vim
|
_detect autoload/SpaceVim/api/data/json.vim
|
||||||
_detect autoload/SpaceVim/api/prompt.vim
|
_detect autoload/SpaceVim/api/prompt.vim
|
||||||
@ -77,21 +82,21 @@ main () {
|
|||||||
""
|
""
|
||||||
" FlyGrep will start to searching code after a delay, the default value is
|
" FlyGrep will start to searching code after a delay, the default value is
|
||||||
" 500ms.
|
" 500ms.
|
||||||
let g:FlyGrep_input_delay = 500
|
let g:FlyGrep_input_delay = get(g:, 'FlyGrep_input_delay', 500)
|
||||||
|
|
||||||
""
|
""
|
||||||
" A list of searching tools will be userd.
|
" A list of searching tools will be userd.
|
||||||
let g:FlyGrep_search_tools = ['ag', 'rg', 'grep', 'pt', 'ack']
|
let g:FlyGrep_search_tools = get(g:, 'FlyGrep_search_tools', ['ag', 'rg', 'grep', 'pt', 'ack'])
|
||||||
|
|
||||||
let g:spacevim_data_dir = '~/.cache'
|
let g:spacevim_data_dir = get(g:, 'spacevim_data_dir', '~/.cache')
|
||||||
|
|
||||||
""
|
""
|
||||||
" Enable FlyGrep statusline
|
" Enable FlyGrep statusline
|
||||||
let g:FlyGrep_enable_statusline = 1
|
let g:FlyGrep_enable_statusline = get(g:, 'FlyGrep_enable_statusline', 1)
|
||||||
|
|
||||||
""
|
""
|
||||||
" Set FlyGrep default command prompt
|
" Set FlyGrep default command prompt
|
||||||
let g:spacevim_commandline_prompt = '➭'
|
let g:spacevim_commandline_prompt = get(g:, 'spacevim_commandline_prompt', '➭')
|
||||||
|
|
||||||
command! -nargs=0 FlyGrep call FlyGrep#open({})
|
command! -nargs=0 FlyGrep call FlyGrep#open({})
|
||||||
EOT
|
EOT
|
||||||
|
@ -167,11 +167,13 @@ endfunction
|
|||||||
|
|
||||||
if s:self.__floating.exists()
|
if s:self.__floating.exists()
|
||||||
function! s:self.close_float() abort
|
function! s:self.close_float() abort
|
||||||
call self.__floating.win_close(self.__winid, 1)
|
if get(self, '__winid', -1) != -1
|
||||||
|
call self.__floating.win_close(self.__winid, 1)
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
else
|
else
|
||||||
function! s:self.close_float() abort
|
function! s:self.close_float() abort
|
||||||
if has_key(self, '__winid') && win_id2tabwin(self.__winid)[0] == tabpagenr()
|
if get(self, '__winid', -1) != -1 && win_id2tabwin(self.__winid)[0] == tabpagenr()
|
||||||
noautocmd execute win_id2win(self.__winid).'wincmd w'
|
noautocmd execute win_id2win(self.__winid).'wincmd w'
|
||||||
noautocmd close
|
noautocmd close
|
||||||
endif
|
endif
|
||||||
|
@ -913,6 +913,10 @@ endfunction
|
|||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
function! s:update_statusline() abort
|
function! s:update_statusline() abort
|
||||||
|
if !g:FlyGrep_enable_statusline
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
if s:SL.support_float() && win_id2tabwin(s:flygrep_win_id)[0] ==# tabpagenr() && s:Window.is_float(win_id2win(s:flygrep_win_id))
|
if s:SL.support_float() && win_id2tabwin(s:flygrep_win_id)[0] ==# tabpagenr() && s:Window.is_float(win_id2win(s:flygrep_win_id))
|
||||||
noautocmd call s:SL.open_float([
|
noautocmd call s:SL.open_float([
|
||||||
\ ['FlyGrep ', 'SpaceVim_statusline_a_bold'],
|
\ ['FlyGrep ', 'SpaceVim_statusline_a_bold'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user