Shougo / ddu.vim

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

Ddu:uiDone is triggered only once #116

Closed cohama closed 4 months ago

cohama commented 4 months ago

Problems summary

Following :h ddu-ui-ff-fqq-25, I set autocmd like bellow.

autocmd User Ddu:uiDone ++nested call ddu#ui#async_action('openFilterWindow')

First, calling ddu#start() work fine. Filter window is automatically opened. However quit the ddu window and then re-call ddu#start(), filter windows does not appeared. It seems that Ddu:uiDone event was triggered only once.

Expected

Ddu:uiDone should triggered evey time ddu#start().

Environment Information

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

syntax enable
filetype plugin indent on

set rtp^=~/tmp/dduuiffmin/ddu-filter-matcher_substring
set rtp^=~/tmp/dduuiffmin/ddu-kind-file
set rtp^=~/tmp/dduuiffmin/ddu-source-line
set rtp^=~/tmp/dduuiffmin/denops.vim
set rtp^=~/tmp/dduuiffmin/ddu.vim
set rtp^=~/tmp/dduuiffmin/ddu-ui-ff
call ddu#custom#patch_global(#{
\   ui: 'ff',
\   sourceOptions: #{
\     _: #{
\       matchers: ['matcher_substring'],
\     },
\   },
\ })

function! s:ddu_my_settings() abort
  nnoremap <buffer><silent> <CR> <Cmd>call ddu#ui#do_action('itemAction', {'name': 'open'})<CR>
  nnoremap <buffer><silent> i <Cmd>call ddu#ui#do_action('openFilterWindow')<CR>
  nnoremap <buffer><silent> q <Cmd>call ddu#ui#do_action('quit')<CR>
endfunction
autocmd FileType ddu-ff call s:ddu_my_settings()

nnoremap L <Cmd>call ddu#start(#{sources: [#{name: "line"}]})<CR>

autocmd User Ddu:uiDone ++nested call ddu#ui#async_action('openFilterWindow')
autocmd User Ddu:uiDone echom 'Ddu:ui Event!'

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

  1. Start vim with vim -u min.vimrc -N min.vimrc or nvim -u min.vimrc min.vimrc
  2. Press L to open ddu. Filter window automatically opened.
  3. Press <Esc> to leave filter windows and q to quit ddu.
  4. Press L again. Filter window does not appear.
  5. :message shows only one line Ddu:ui Event!. Ddu:uiDone event triggered only once.
Shougo commented 4 months ago

Fixed. Please update ddu.vim.

cohama commented 4 months ago

Confirmed. Thanks