Shougo / ddu-ui-ff

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

autoAction is not applied when do cursorNext/cursorPrevious from filter #150

Closed 4513ECHO closed 4 months ago

4513ECHO commented 4 months ago

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

Problems summary

ddu-ui-ff-param-autoAction is not applied (e.g. preview) when do cursorNext/cursorPrevious action from filter.

Expected

autoAction should be applied.

Environment Information

Neovim ``` NVIM v0.11.0-dev-3589+g1f2f460b4-Homebrew Build type: Release LuaJIT 2.1.1720049189 Run ":verbose version" for more info ```
Vim ``` VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Jul 14 2024 09:43:21) macOS 版 - arm64 適用済パッチ: 1-568 Compiled by Homebrew Huge 版 without GUI. 機能の一覧 有効(+)/無効(-) +acl -ebcdic +lua -python +title +arabic +emacs_tags +menu +python3 -toolbar +autocmd +eval +mksession +quickfix +user_commands +autochdir +ex_extra +modify_fname +reltime +vartabs -autoservername +extra_search +mouse +rightleft +vertsplit -balloon_eval -farsi -mouseshape +ruby +vim9script +balloon_eval_term +file_in_path +mouse_dec +scrollbind +viminfo -browse +find_in_path -mouse_gpm +signs +virtualedit ++builtin_terms +float -mouse_jsbterm +smartindent +visual +byte_offset +folding +mouse_netterm +sodium +visualextra +channel -footer +mouse_sgr +sound +vreplace +cindent +fork() -mouse_sysmouse +spell +wildignore -clientserver +gettext +mouse_urxvt +startuptime +wildmenu +clipboard -hangul_input +mouse_xterm +statusline +windows +cmdline_compl +iconv +multi_byte -sun_workshop +writebackup +cmdline_hist +insert_expand +multi_lang +syntax -X11 +cmdline_info +ipv6 -mzscheme +tag_binary -xattr +comments +job +netbeans_intg -tag_old_static -xfontset +conceal +jumplist +num64 -tag_any_white -xim +cryptv +keymap +packages -tcl -xpm +cscope +lambda +path_extra +termguicolors -xsmp +cursorbind +langmap +perl +terminal -xterm_clipboard +cursorshape +libcall +persistent_undo +terminfo -xterm_save +dialog_con +linebreak +popupwin +termresponse +diff +lispindent +postscript +textobjects +digraphs +listcmds +printer +textprop -dnd +localmap +profile +timers システム vimrc: "$VIM/vimrc" ユーザー vimrc: "$HOME/.vimrc" 第2ユーザー vimrc: "~/.vim/vimrc" 第3ユーザー vimrc: "$XDG_CONFIG_HOME/vim/vimrc" ユーザー exrc: "$HOME/.exrc" デフォルトファイル: "$VIMRUNTIME/defaults.vim" 省略時の $VIM: "/Users/234531sch/Library/homebrew/share/vim" コンパイル: clang -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -I/Users/234531sch/Library/homebrew/Cellar/libsodium/1.0.20/include -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 リンク: clang -o vim -lm -lncurses -L/Users/234531sch/Library/homebrew/Cellar/libsodium/1.0.20/lib -lsodium -liconv -lintl -framework AppKit -L/Users/234531sch/Library/homebrew/opt/lua/lib -llua5.4 -mmacosx-version-min=14.4 -fstack-protector-strong -L/Users/234531sch/Library/homebrew/opt/perl/lib/perl5/5.38/darwin-thread-multi-2level/CORE -lperl -L/Users/234531sch/Library/homebrew/opt/python@3.12/Frameworks/Python.framework/Versions/3.12/lib/python3.12/config-3.12-darwin -lpython3.12 -lintl -framework CoreFoundation -lruby.3.3 -L/Users/234531sch/Library/homebrew/Cellar/ruby/3.3.4/lib ```

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

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

nnoremap mm <Cmd>call ddu#start(#{
      \ sources: [#{ name: 'file_rec' }],
      \ ui: 'ff',
      \ uiParams: #{
      \   ff: #{
      \     autoAction: #{ name: 'preview' },
      \     startAutoAction: v:true,
      \   },
      \ }
      \ })<CR>
cnoremap <C-n> <Cmd>call ddu#ui#do_action('cursorNext')<CR>

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

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

  1. type mm
  2. type <C-n> but preview is not updated

Screenshot (if possible)

None.

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

None.

4513ECHO commented 4 months ago

The reason for the issue seems to be that CursorMoved is invoked "After the cursor was moved in Normal or Visual mode".

                            *CursorMoved*
CursorMoved         After the cursor was moved in Normal or Visual
                mode or to another window.  Also when the text
                of the cursor line has been changed, e.g. with
                "x", "rx" or "p".
                Not always triggered when there is typeahead,
                while executing commands in a script file, or
                when an operator is pending.
                For an example see |match-parens|.
                Note: Cannot be skipped with |:noautocmd|.
                Careful: This is triggered very often, don't
                do anything that the user does not expect or
                that is slow.
Shougo commented 4 months ago

Fixed.