TaDaa/vimade

search highlight while faded question

mckellyln opened this issue · 12 comments

Just a question:
Hi,
Thanks for awesome vimade.
Is there a way to keep search highlight on for the faded windows ?
thx,
-m
Also, extra question - in a pum completion when I scroll it causes heavy flashing - could we somehow disable the dimming for the parent of the pum while the pum is active ?

TaDaa commented

Hi @mckellyln,

For search highlighting, the following should show search results:

let g:vimade={}
let g:vimade.fadepriority=0

For the pum completion, I will need some more information about your configuration:

  • Vim, NVim and which version
  • Terminal or GUI
  • OS
  • Minimal vimrc or init.vim if possible
  • Screenshot / gif may be helpful as well.

@TaDaa thanks so much. I read through the doc but just did not see the comment about hlsearch and priority, sorry for that.
For the other issue, I am using vim 8.2.480 in terminal mode on Ubuntu.
I'll try to come up with a vimrc that can demonstrate it, and/or send a pic.
The plugins I use are:
Plugin 'justmao945/vim-clang'
Plugin 'mckellyln/vim-rtags'
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'
Plugin 'bfrg/vim-cpp-modern'
Plugin 'itchyny/lightline.vim'
Plugin 'TaDaa/vimade'
Plugin 'tmux-plugins/vim-tmux-focus-events'
It works correctly - its just the flash/redraw on every up/down that I'm hoping to improve.
I'll try some different terminals also to see if makes any difference.
thx again,
-m

Not sure of best way to show, but here is a pic of the window:
pum_flash
When I Up/Down the pum each window behind it redraws with a slight flash. Without vimade I never noticed any redraw issue. I just wondered if maybe disabling the fade for at least the window parent of the pum might help ?

@TaDaa I've had some success with adding:
au! CompleteChanged * call vimade#WinDisable()
au! CompleteDone * call vimade#WinEnable()

Hi,
I used this below, seems to help, so I'll close the issue. If you want me to try anything else jlmk.
Thanks again for such a great plugin/code. -m

function! MyVimadeWinDisable()
    if exists('g:vimade_init') && exists('g:vimade_running')
        if g:vimade_running == 1
            if !exists('g:vimade_disabled')
                call vimade#WinDisable()
            elseif w:vimade_disabled == 0
                call vimade#WinDisable()
            endif
        endif
    endif
endfunction

function! MyVimadeWinEnable()
    if exists('g:vimade_init') && exists('g:vimade_running')
        if g:vimade_running == 1
            if !exists('g:vimade_disabled')
                return
            elseif w:vimade_disabled != 0
                call vimade#WinEnable()
            endif
        endif
    endif
endfunction

au! CompleteChanged * call MyVimadeWinDisable()
au! CompleteDone    * call MyVimadeWinEnable()
TaDaa commented

Thanks for looking into this -- was wondering was the flicker occurring only on the window with the code in it, the quickfix window, or the middle window (not sure what that middle one is), or a combination of all of them?

I would say it was on all, but noticed it mostly on the code window., perhaps only because it is the largest? And the pop up navigation (up/down/repeat) was quite a bit slower without this.
The middle window is more info about each pop up menu item (function types etc.), so it changes when changing the menu item. Perhaps dimming had to cycle through that on each menu change ?

TaDaa commented

Super interesting - I can confirm that there is a performance benefit as far as cursor responsiveness is concerned even in neovim. As to why I'm not sure -- need to dig into this more later.

For the flicker I think that changing of the middle window or possibly quickfix is indeed triggering BufEnter and causing Vimade to initiate a redraw. I think ideally the plugin handling those lists and switching back to the code window should be using noautocmd so that there isn't performance degradation.

ok, cool. I can try to update the other plugin(s). But need a little help with the noautocmd you suggest. What command are you thinking should turn off the BufEnter event ?

I tried this in autoload/vimade.vim
(commenting out my CompleteChanged/CompleteDone autocmds above):

function! vimade#CheckWindows()
  call vimade#UpdateState()
  "prevent if inside popup window
~ if winnr() == 0 || pumvisible()
    return
  endif
  if g:vimade_running && g:vimade_paused == 0 && getcmdwintype() == ''

And it works great also.

@TaDaa hi, do you want me to issue a PR for that change ? Or is there more to look into ? thx, -m

TaDaa commented

Sorry for ghosting, been swamped for a few days -- I'll add it now, looks great!