Shougo / ddu-ui-filer

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

When you delete a file, the whole tree closes. #42

Closed nabezokodaikon closed 6 months ago

nabezokodaikon commented 6 months ago

Sorry for bothering you again. I found a new bug.

Problems summary

When you delete a file, the whole tree closes.

Currently, if you delete a file and then redraw the tree in a closed state, the tree state will be restored.

Expected

Deleting a file does not close the tree.

Environment Information

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

set rtp+=~/work/denops.vim
set rtp+=~/work/ddu.vim
set rtp+=~/work/ddu-ui-filer
set rtp+=~/work/ddu-source-file
set rtp+=~/work/ddu-column-filename
set rtp+=~/work/ddu-kind-file

call ddu#start(#{
      \   ui: 'filer',
      \   resume: v:true,
      \   sync: v:true,
      \   sources: [
      \     #{name: 'file'},
      \   ],
      \   sourceOptions: #{
      \     file: #{
      \       columns: ['filename'],
      \       path: getcwd()
      \     }
      \   }
      \ })

autocmd FileType ddu-filer call s:ddu_filer_my_settings()
function s:ddu_filer_my_settings() abort
  nnoremap <buffer> o
  \ <Cmd>call ddu#ui#do_action('expandItem', {'mode': 'toggle'})<CR>
  nnoremap <buffer> D
  \ <Cmd>call ddu#ui#do_action('itemAction', {'name': 'delete'})<CR>
  nnoremap <buffer> <C-l>
  \ <Cmd>call ddu#ui#do_action('redraw')<CR>
endfunction

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

  1. $ mkdir -p foo/bar/hoge/
  2. $ touch foo/bar/hoge/text.txt
  3. $ cd foo
  4. $ nvim
  5. In the filer, perform a switch operation to the bar directory.
  6. In the filer, perform a switch operation to the hoge directory.
  7. Delete the text.txt file.
  8. This closes the whole tree. <--I consider this behavior a bug.
  9. In the filer, perform a redraw operation.
  10. The state of the tree is restored.
Shougo commented 6 months ago

Fixed. Please update ddu.vim.

nabezokodaikon commented 6 months ago

I updated and confirmed. This issue has been resolved, but when adding new files, the files appear redundant.

スクリーンショット 2024-05-20 102008

Shougo commented 6 months ago

Too bad.

Shougo commented 6 months ago

Fixed.

nabezokodaikon commented 6 months ago

I confirmed it. Thank you.