Shougo / ddu-ui-filer

File listing UI for ddu.vim
MIT License
55 stars 8 forks source link

Freezes when executing sync_action(do_action) in filer buffer #43

Closed yasunori0418 closed 4 months ago

yasunori0418 commented 4 months ago

Problems summary

If you execute sync_action(do_action) in ddu-ui-filer, it will not accept any further operations and the editor will freeze.

Expected

Environment Information

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713484068
Run ":verbose version" for more info
:version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jun 17 2024 22:29:09)
Included patches: 1-496
Compiled by Arch Linux
Huge version without GUI.  Features included (+) or not (-):
+acl               +cryptv            +fork()            +modify_fname      +persistent_undo   -sun_workshop      +viminfo
+arabic            +cscope            +gettext           +mouse             +popupwin          +syntax            +virtualedit
+autocmd           +cursorbind        -hangul_input      -mouseshape        +postscript        +tag_binary        +visual
+autochdir         +cursorshape       +iconv             +mouse_dec         +printer           -tag_old_static    +visualextra
-autoservername    +dialog_con        +insert_expand     +mouse_gpm         +profile           -tag_any_white     +vreplace
-balloon_eval      +diff              +ipv6              -mouse_jsbterm     -python            +tcl/dyn           +wildignore
+balloon_eval_term +digraphs          +job               +mouse_netterm     +python3/dyn       +termguicolors     +wildmenu
-browse            -dnd               +jumplist          +mouse_sgr         +quickfix          +terminal          +windows
++builtin_terms    -ebcdic            +keymap            -mouse_sysmouse    +reltime           +terminfo          +writebackup
+byte_offset       +emacs_tags        +lambda            +mouse_urxvt       +rightleft         +termresponse      -X11
+channel           +eval              +langmap           +mouse_xterm       +ruby/dyn          +textobjects       +xattr
+cindent           +ex_extra          +libcall           +multi_byte        +scrollbind        +textprop          -xfontset
-clientserver      +extra_search      +linebreak         +multi_lang        +signs             +timers            -xim
-clipboard         -farsi             +lispindent        -mzscheme          +smartindent       +title             -xpm
+cmdline_compl     +file_in_path      +listcmds          +netbeans_intg     -sodium            -toolbar           -xsmp
+cmdline_hist      +find_in_path      +localmap          +num64             -sound             +user_commands     -xterm_clipboard
+cmdline_info      +float             +lua/dyn           +packages          +spell             +vartabs           -xterm_save
+comments          +folding           +menu              +path_extra        +startuptime       +vertsplit
+conceal           -footer            +mksession         +perl/dyn          +statusline        +vim9script
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
 3rd user vimrc file: "$XDG_CONFIG_HOME/vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wformat -Werror=format-security -fsta
ck-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/vim/src=/usr/src/debug/vim -fl
to=auto -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.38/core_perl/CORE -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-rel
ative-relocs -flto=auto -L/usr/local/lib -o vim -lm -ltinfo -lacl -lattr -lgpm -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm

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

const s:plugin_dir = '~/.cache/dpp/repos/github.com'->expand()
const s:plugins = [
  \ 'vim-denops/denops.vim',
  \ 'Shougo/ddu.vim',
  \ 'Shougo/ddu-ui-filer',
  \ 'Shougo/ddu-kind-file',
  \ 'Shougo/ddu-source-file',
  \ 'Shougo/ddu-filter-matcher_substring'
\ ]

for p in s:plugins
  execute $'set rtp^={s:plugin_dir}/{p}'
endfor

call ddu#custom#patch_global(#{
  \ ui: 'filer',
  \ kindOptions: #{
    \ file: #{
      \ defaultAction: "open",
    \ },
  \ },
  \ sources: [
    \ #{
      \ name: 'file',
      \ options: #{
        \ matchers: ['matcher_substring'],
      \ }
    \ },
  \ ],
\ })

function! s:keymaps() abort
  nnoremap <buffer> <CR> <Cmd>call ddu#ui#sync_action("itemAction")<CR>
  nnoremap <buffer> q <Cmd>call ddu#ui#sync_action("quit")<CR>
endfunction

augroup filer
  autocmd!
  autocmd FileType ddu-filer call s:keymaps()
augroup END

command! Test call ddu#start()

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

  1. Start the editor.
    • Neovim -> nvim -u init.vim
    • Vim -> vim -N -u init.vim
  2. Start filer.
    • :Test
  3. Perform any action
    • Open file with <CR>
    • Close ui with q

The editor will freeze and won't accept any operations!

Shougo commented 4 months ago

Fixed. Please update ddu.vim.