Shougo / ddu-ui-filer

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

action collapseItem dose not work well. #12

Closed ryota2357 closed 2 years ago

ryota2357 commented 2 years ago

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

Problems summary

When closing 2 or more expanded directories, collapseItem does not work.

Expected

Close all expanded directories.

Environment Information

NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@HMBRW-A-001-M1-004.local

Features: +acl +iconv +tui
See ":help feature-compile"

      システム vimrc: "$VIM/sysinit.vim"
       省略時の $VIM: "/opt/homebrew/Cellar/neovim/0.7.2_1/share/nvim"

Run :checkhealth for more info

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

I used the column, but it is not necessary for reproducing this problem.

if !has("nvim")
  set nocompatible
  filetype plugin indent on
  syntax enable
endif

let s:plugins = [
      \ 'vim-denops/denops.vim',
      \ 'Shougo/ddu.vim',
      \ 'Shougo/ddu-ui-filer',
      \ 'Shougo/ddu-source-file',
      \ 'ryota2357/ddu-column-icon_filename',
      \ ]

for item in s:plugins
  execute 'set runtimepath+=~/.cache/dein/repos/github.com/' . item
endfor

call ddu#custom#patch_global({
    \   'ui': 'filer',
    \   'sources': [{'name': 'file'}],
    \   'sourceOptions' : {
    \     '_': { 'columns': ['icon_filename'] }
    \   },
    \ })

autocmd FileType ddu-filer call s:ddu_my_settings()
function! s:ddu_my_settings() abort
  nnoremap <buffer> c <Cmd>call ddu#ui#filer#do_action('collapseItem')<CR>
  nnoremap <buffer> e <Cmd>call ddu#ui#filer#do_action('expandItem')<CR>
endfunction
nnoremap <Space>o <Cmd>call ddu#start()<CR>

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

  1. start ddu by <Space>o
  2. on the directory push e to expand the directory, and in the hierarchy, re-expand another directory.
  3. back to the top directory of the expanded directory, push c to close.

Screenshot (if possible)

https://user-images.githubusercontent.com/61523777/185085076-6e431b5d-ffa4-482f-9621-69befd651c6f.mov

Shougo commented 2 years ago

Fixed.

ryota2357 commented 2 years ago

Confirmed. Thank you.