Shougo / ddu-kind-file

File kind for ddu.vim
MIT License
25 stars 9 forks source link

Odd behavior with filer #8

Closed ryota2357 closed 2 years ago

ryota2357 commented 2 years ago

Problems summary

newFile, rename, trash are breaks tree-view.

Please see the below movie.

https://user-images.githubusercontent.com/61523777/202909546-d6ce34c1-8630-4e9b-8721-0249b4744d96.mov

  1. Start ddu.
  2. Create new file hoge/fuga/bar.txt with newFile
  3. Delete hoge/fuga/bar.txt with trash
  4. Rename hoge/fuga/foo.txt to hoge/fuga/foo1.txt with rename

Expected

Does not breaks the tree-view.

Environment Information

:version
NVIM v0.8.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@Ventura-arm64.local

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

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

Run :checkhealth for more info

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

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

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', 'params': {}}],
    \   'resume': v:true,
    \   'sourceOptions': {
    \     '_': {
    \       'columns': ['icon_filename'],
    \     },
    \   },
    \   'kindOptions': {
    \     'file': {
    \       'defaultAction': 'open',
    \     },
    \   }
    \ })

autocmd FileType ddu-filer call s:ddu_my_settings()
function! s:ddu_my_settings() abort
  nnoremap <buffer><expr><silent><CR> ddu#ui#filer#is_tree()
    \ ? "<Cmd>call ddu#ui#filer#do_action('expandItem', {'mode': 'toggle'})<CR>"
    \ : "<Cmd>call ddu#ui#filer#do_action('itemAction')<CR>"
  nnoremap <buffer><silent> q <Cmd>call ddu#ui#filer#do_action('quit')<CR>
  nnoremap <buffer> n <Cmd>call ddu#ui#filer#do_action('itemAction', { 'name': 'newFile' })<CR>
  nnoremap <buffer> r <Cmd>call ddu#ui#filer#do_action('itemAction', { 'name': 'rename' })<CR>
  nnoremap <buffer> d <Cmd>call ddu#ui#filer#do_action('itemAction', { 'name': 'trash' })<CR>
endfunction

In the movie, I use icon_filename for ddu-column, but the same problem occurs with filename

Shougo commented 2 years ago

It is not the issue of ddu-kind-file.

Shougo commented 2 years ago

Fixed. Please update ddu-ui-filer.