Shougo / ddu-ui-ff

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

`openFilterWindow` doesn't work well when `startFilter` option is true and fire `redraw` action #132

Closed kamecha closed 8 months ago

kamecha commented 8 months ago

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

Problems summary

there are some problem using openFilterWindow like bellow

  1. filter window is opened other place before
    1. use ddu#ui#do_action('closeFilterWindow')
    2. use ddu#ui#do_action('redraw', #{ method: 'uiRedraw' })
    3. use ddu#ui#do_action('openFilterWindow')
  2. i or A is inputted to filter window
    1. use ddu#ui#do_action('redraw', #{ method: 'uiRedraw' })
    2. use ddu#ui#do_action('closeFilterWindow')
    3. use ddu#ui#do_action('openFilterWindow')

Expected

it works well without these problems.

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

function s:update_ui_layout() abort
    let l:current_options = ddu#custom#get_current()
    if l:current_options->empty()
        return
    endif
        " ↓ this function order seems to be important
    call ddu#ui#do_action('redraw', #{ method: 'uiRedraw' })
    call ddu#ui#do_action('closeFilterWindow')
    call ddu#ui#do_action('openFilterWindow')
endfunction

autocmd VimResized * call s:update_ui_layout()

nnoremap [ddu] <Nop>
nmap <Space>u [ddu]
nmap <silent> [ddu]f <Cmd>call ddu#start(#{
            \ ui: 'ff',
            \ uiParams: #{
            \   ff: #{
            \     startFilter: v:true,
            \   }
            \ }
            \ })<CR>

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#do_action('leaveFilterWindow')<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 fire leaveFilterWindow action
  3. resize vim ( resize terminal window by using mouse ) to fire s:update_ui_layout
  4. there are some problem depending on the function order above
    • filter window is opened other place before
    • i or A is inputted to filter window ← if the order is above .vimrc, this problem is appeared.

Screenshot if possible

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

Shougo commented 8 months ago

Hm...

I should remove startFilter feature...

Shougo commented 8 months ago

I will remove the feature. Please wait.

Shougo commented 8 months ago

I have removed startFilter option.