Shougo / ddu-ui-ff

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

when fire the action via chooseAction with `startFilter=true` options, the mode will be INSERT. #129

Closed kamecha closed 10 months ago

kamecha commented 10 months ago

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

Problems summary

SSIA

Expected

the mode after firing the action is expected to be INESRT.

Environment Information

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

set rtp+=~/.cache/dein/nvim/repos/github.com/vim-denops/denops.vim

set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu.vim
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu-ui-ff
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu-source-file
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu-source-action
set rtp+=~/.cache/dein/nvim/repos/github.com/Shougo/ddu-kind-file

let s:ddu_config_json =<< trim MARK
    {
        "ui": "ff",
        "uiParams": {
            "ff": {
                "startFilter": true
            }
        },
        "kindOptions": {
            "action": {
                "defaultAction": "do"
            }
        }
    }
MARK

let s:ddu_config_json = s:ddu_config_json->join('')->json_decode()

call ddu#custom#patch_global(s:ddu_config_json)

nnoremap [ddu] <Nop>
nmap <Space>u [ddu]
nmap <silent> [ddu]f <Cmd>call ddu#start({
            \ 'ui': 'ff',
            \ 'sources': [{'name': 'file', 'params': {}}],
            \ })<CR>

autocmd FileType ddu-ff call s:ddu_my_settings()

function! s:ddu_my_settings() abort
    nnoremap <buffer> <CR>
                \ <ESC><Cmd>call ddu#ui#do_action('itemAction')<CR>
    nnoremap <buffer> a
                \ <Cmd>call ddu#ui#do_action('chooseAction')<CR>
    nnoremap <buffer><silent> 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> <C-l>
                \ <ESC><Cmd>call ddu#ui#ff#do_action('leaveFilterWindow')<CR>
    inoremap <buffer> <C-q>
                \ <ESC><Cmd>call ddu#ui#ff#do_action('quit')<CR>
endfunction

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

  1. type <Space> u f to start ddu
  2. type <C-l> in filter window to leave filter window
  3. type a to fire chooseAction
  4. move cursor to open action
  5. type <CR> to fire open action

Screenshot (if possible)

hoge

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

kamecha commented 10 months ago

I think that startFilter should be applied even after chooseAction.

However there are other ui like ddu-ui-filer that don't have startFilter otpion, So it seems to be difficult from a compatibility point of view.

Shougo commented 10 months ago

Fixed. Please update ddu-source-action.