Shougo / ddu-ui-ff

Fuzzy finder UI for ddu.vim
MIT License
55 stars 26 forks source link

Multiple filter windows are created on incremental update #27

Closed matsui54 closed 2 years ago

matsui54 commented 2 years ago

Problem

Filter windows are created every time items are enqueued.

Environment

Neovim v0.7.0

Minimal vimrc

set runtimepath+=~/.cache/dein/repos/github.com/vim-denops/denops.vim
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddu.vim
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddu-ui-ff
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddu-kind-file
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/ddu-source-file_rec

nnoremap <Space>f
      \ <Cmd>call ddu#start({'sources': [{'name': 'file_rec'}]})<CR>

call ddu#custom#patch_global({
      \ 'ui': 'ff',
      \ 'uiParams': {'ff': {
      \   'split': 'floating',
      \   'autoResize': v:true,
      \ }},
      \ })

autocmd FileType ddu-ff call s:ddu_ff_my_settings()
function! s:ddu_ff_my_settings() abort
  nnoremap <buffer> i
        \ <Cmd>call ddu#ui#ff#do_action('openFilterWindow')<CR>
  nnoremap <buffer> q
        \ <Cmd>call ddu#ui#ff#do_action('quit')<CR>
endfunction

autocmd FileType ddu-ff-filter call s:ddu_filter_my_settings()
function! s:ddu_filter_my_settings() abort
  inoremap <buffer> <CR> <Esc><Cmd>close<CR>
endfunction

Reproduce steps

  1. start nvim and cd to large directory (which has more than 200000 files)
  2. execute <Space>f (start ddu)
  3. type i (open filter window) immediately after the ddu window appears
  4. type <CR> (close filter window) immediately after the filter window appears
  5. wait for items are enqueued

Screenshot

ddu_incremental

matsui54 commented 2 years ago

Thank you, but though I closed the filter window, the filter window is automatically opened when the items are enqueued.

ddu_incremental_bug

Shougo commented 2 years ago

Fixed. Please update.

matsui54 commented 2 years ago

It seems fixed. Thank you!