1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-09 11:50:05 +08:00

feat(flygrep): hide guicursor

This commit is contained in:
wsdjeg 2022-04-04 21:37:51 +08:00
parent 9042571586
commit a1ec2b9bac
2 changed files with 108 additions and 110 deletions

View File

@ -100,21 +100,13 @@ function! s:self.hide_in_normal(name) abort
if empty(group) if empty(group)
return return
endif endif
if (exists('+termguicolors') && &termguicolors ) || has('gui_running') let normal = self.group2dict('Normal')
let bg = self.group2dict('Normal').guibg let guibg = get(normal, 'guibg', '')
if empty(bg) let ctermbg = get(normal, 'ctermbg', '')
return let group.guifg = guibg
endif let group.guibg = guibg
let group.guifg = bg let group.ctermfg = ctermbg
let group.guibg = bg let group.ctermbg = ctermbg
else
let bg = self.group2dict('Normal').ctermbg
if empty(bg)
return
endif
let group.ctermfg = bg
let group.ctermbg = bg
endif
call self.hi(group) call self.hi(group)
endfunction endfunction

View File

@ -874,9 +874,15 @@ function! SpaceVim#plugins#flygrep#open(argv) abort
let save_tve = &t_ve let save_tve = &t_ve
setlocal t_ve= setlocal t_ve=
let cursor_hi = {} let cursor_hi = {}
if has('gui_running')
let cursor_hi = s:HI.group2dict('Cursor') let cursor_hi = s:HI.group2dict('Cursor')
let lcursor_hi = s:HI.group2dict('lCursor')
let guicursor = &guicursor
call s:HI.hide_in_normal('Cursor') call s:HI.hide_in_normal('Cursor')
call s:HI.hide_in_normal('lCursor')
" hi Cursor ctermbg=16 ctermfg=16 guifg=#282c34 guibg=#282c34
" hi lCursor ctermbg=16 ctermfg=16 guifg=#282c34 guibg=#282c34
if has('nvim')
set guicursor+=a:Cursor/lCursor
endif endif
" setlocal nomodifiable " setlocal nomodifiable
setf SpaceVimFlyGrep setf SpaceVimFlyGrep
@ -926,9 +932,9 @@ function! SpaceVim#plugins#flygrep#open(argv) abort
endif endif
call s:LOGGER.info('FlyGrep ending ===========================') call s:LOGGER.info('FlyGrep ending ===========================')
let &t_ve = save_tve let &t_ve = save_tve
if has('gui_running')
call s:HI.hi(cursor_hi) call s:HI.hi(cursor_hi)
endif call s:HI.hi(lcursor_hi)
let &guicursor = guicursor
endfunction endfunction
" }}} " }}}