Shougo / ddu-ui-ff

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

`ddu-ff-filter` ended up being replaced by other buffer #50

Closed Omochice closed 2 years ago

Omochice commented 2 years ago

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

Problems summary

When re-open ddu buffer, raise E444 and filter buffer is replaced by preview buffer. It seem to occur when 'autoAction': { 'name': 'preview' } is specified.

Expected

Raise no error, open filter buffer.

Environment Information

$ git rev-parse HEAD
53e4490e74de37deabf8a23dc9fa8eced1a7a1a0
$ git rev-parse HEAD
a40e0c10be0c67b5fd6cb9713914b9259dafa7e2
$ deno --version
deno 1.24.2 (release, x86_64-unknown-linux-gnu)
v8 10.4.132.20
typescript 4.7.4

Ubuntu 20.04.4 LTS (via WSL2)

NVIM v0.8.0-dev-810-g252dea592
Build type: Release
LuaJIT 2.1.0-beta3

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

set runtimepath^=/tmp/ddu-issue/denops.vim
set runtimepath^=/tmp/ddu-issue/ddu.vim
set runtimepath^=/tmp/ddu-issue/ddu-ui-ff
set runtimepath^=/tmp/ddu-issue/ddu-kind-file
set runtimepath^=/tmp/ddu-issue/ddu-filter-matcher_substring
set runtimepath^=/tmp/ddu-issue/ddu-source-file_rec

call ddu#custom#patch_global({
    \   'ui': 'ff',
    \   'sources': [{'name': 'file_rec', 'params': {}}],
    \   'sourceOptions': {
    \     '_': {
    \       'matchers': ['matcher_substring'],
    \     },
    \   },
    \   'kindOptions': {
    \     'file': {
    \       'defaultAction': 'open',
    \     },
    \   },
    \   'uiParams': {
    \     'ff': {
    \       'autoAction': { 'name': 'preview' },
    \       'startFilter': v:true,
    \     },
    \   },
    \ })

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

  1. Execute call ddu#start({})
  2. Move ddu-ff-default buffer and move cursor
  3. Quit ddu buffers
  4. Re-execute call ddu#start({})

Screenshot (if possible)

https://user-images.githubusercontent.com/44566328/184104823-e1c9d085-8504-4aaf-9c38-04102784fde1.mp4

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

[ddu] ui: ff "redraw()" failed
[ddu] Vim(close):E444: Cannot close last window
[ddu] BatchError: Vim(close):E444: Cannot close last window^@    at DenopsImpl.batch (file:///tmp/ddu-issue/denops.vim/denops/@denops/impl.ts:45:13)^@    at async batch (https://deno.land/x/denops_std@v3.5.0/batch/batch.ts:98:3)^@    at async PreviewUi.close (file:///tmp/ddu-issue/ddu-ui-ff/denops/@ddu-ui-ff/preview.ts:37:7)^@    at async Ui.redraw (file:///tmp/ddu-issue/ddu-ui-ff/denops/@ddu-uis/ff.ts:115:7)^@    at async file:///tmp/ddu-issue/ddu.vim/denops/ddu/ddu.ts:1441:7^@    at async Lock.with (https://deno.land/x/async@v1.1.5/lock.ts:23:7)^@    at async uiRedraw (file:///tmp/ddu-issue/ddu.vim/denops/ddu/ddu.ts:1439:3)^@    at async Ddu.uiRedraw (file:///tmp/ddu-issue/ddu.vim/denops/ddu/ddu.ts:429:5)^@    at async Ddu.start (file:///tmp/ddu-issue/ddu.vim/denops/ddu/ddu.ts:195:5)^@    at async Session.start (file:///tmp/ddu-issue/ddu.vim/denops/ddu/app.ts:130:7)
Shougo commented 2 years ago

Fixed.