Shougo / ddu.vim

Dark deno-powered UI framework for Vim/NeoVim
MIT License
295 stars 23 forks source link

Unexpected background color when cursor has moved with `ddu#ui#ff#execute()` #27

Closed lambdalisue closed 2 years ago

lambdalisue commented 2 years ago

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

Somehow unexpected background is applied to previous selected lines. When you hit <C-o><C-l>, the highlight is fixed.

https://user-images.githubusercontent.com/546312/188069762-56e751d6-478e-4a4e-b0d2-a573caac50cb.mp4

Expected

Only current selected line is highlighted.

Environment Information

Provide a minimal init.vim/vimrc without plugin managers (Required!)

if exists('+compatible') && &compatible
  set nocompatible
endif

" Disable Vim's native pack feature
set packpath=

" Clone https://github.com/lambdalisue/fern.vim in somewhere
" and specify that directory to the below
set runtimepath^=~/.config/nvim/pack/jetpack/src/github.com/vim-denops/denops.vim
set runtimepath^=~/.config/nvim/pack/jetpack/src/github.com/Shougo/ddu.vim
set runtimepath^=~/.config/nvim/pack/jetpack/src/github.com/Shougo/ddu-ui-ff
set runtimepath^=~/.config/nvim/pack/jetpack/src/github.com/Shougo/ddu-source-file_rec
set runtimepath^=~/.config/nvim/pack/jetpack/src/github.com/Shougo/ddu-filter-matcher_substring
set runtimepath^=~/.config/nvim/pack/jetpack/src/github.com/EdenEast/nightfox.nvim

filetype plugin indent on
syntax on
"----------------------------------------------------------------

nnoremap ; :
nnoremap : ;

call ddu#custom#patch_global({
      \ 'ui': 'ff',
      \ 'sources': [
      \   {
      \     'name': 'file_rec',
      \   },
      \ ],
      \ 'sourceOptions': {
      \   '_': {
      \     'matchers': ['matcher_substring'],
      \   },
      \ },
      \ 'uiParams': {
      \   'ff': {
      \     'split': 'floating',
      \     'startFilter': v:true,
      \     'prompt': '> ',
      \   },
      \ },
      \})

function! s:my_ddu_ff() abort
  nnoremap <buffer><silent> <Esc>
        \ <Cmd>call ddu#ui#ff#do_action('quit')<CR>
endfunction

function! s:my_ddu_ff_filter() abort
  inoremap <buffer><silent> <Esc> <Esc><Cmd>call ddu#ui#ff#close()<CR>
  nnoremap <buffer><silent> <Esc> <Cmd>call ddu#ui#ff#close()<CR>

  inoremap <buffer><silent> <C-n>
      \ <Cmd>call ddu#ui#ff#execute("call cursor(line('.')+1,0)")<CR>
  inoremap <buffer><silent> <C-p>
      \ <Cmd>call ddu#ui#ff#execute("call cursor(line('.')-1,0)")<CR>
endfunction

augroup my-ddu
  autocmd!
  autocmd FileType ddu-ff call s:my_ddu_ff()
  autocmd FileType ddu-ff-filter call s:my_ddu_ff_filter()
augroup END

colorscheme nightfox

"----------------------------------------------------------------
echomsg "Custom minimal vimrc has loaded"

How to reproduce the problem from neovim/Vim startup (Required!)

  1. call ddu#start({})
  2. Hit <C-n> or <C-p>

Screenshot (if possible)

Upload the log messages by :redir and :message (if errored)

Shougo commented 2 years ago

Hi. I have tested it and it works as expected.

I think it is the bug of your terminal or affect with tmux. Please test it in more bare environment.

Shougo commented 2 years ago

I don't reproduce the problem with tmux. Please test it in more bare environment.

Shougo commented 2 years ago

Reproduced.

Shougo commented 2 years ago

Fixed. Please update ddu-ui-ff.