Shougo / ddu-ui-filer

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

Items appear redundant when redrawn #39

Closed nabezokodaikon closed 6 months ago

nabezokodaikon commented 6 months ago

Problems summary

Items appear redundant when redrawn.

Expected

Items are no longer redundant when redrawn.

Environment Information

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

init.lua

vim.opt.runtimepath:prepend('~/.cache/dpp/repos/github.com/vim-denops/denops.vim')
vim.opt.runtimepath:prepend('~/.cache/dpp/repos/github.com/Shougo/ddu.vim')
vim.opt.runtimepath:prepend('~/.cache/dpp/repos/github.com/Shougo/ddu-ui-filer')
vim.opt.runtimepath:prepend('~/.cache/dpp/repos/github.com/Shougo/ddu-source-file')
vim.opt.runtimepath:prepend('~/.cache/dpp/repos/github.com/Shougo/ddu-column-filename')
vim.opt.runtimepath:prepend('~/.cache/dpp/repos/github.com/Shougo/ddu-kind-file')

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

  1. $ mkdir -p foo/bar
  2. $ cd foo
  3. $ nvim
  4. :lua vim.fn['ddu#start'] { ui = 'filer', resume = true, sync = true, sources = { {name = 'file'} }, sourceOptions = { file = { columns = { 'filename' }, path = vim.fn.getcwd() } } }
  5. Selected bar directory.
  6. :call ddu#ui#do_action('expandItem', {'mode': 'toggle'})
  7. :call ddu#ui#do_action('itemAction', {'name': 'newFile'})
  8. Create hoge.txt file.
  9. :call ddu#ui#do_action('redraw')

Screenshot (if possible)

スクリーンショット 2024-05-15 034430

Shougo commented 6 months ago

Please don't use lua script for the reproduce instruction.

Shougo commented 6 months ago

I have created the minimal config.

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> N
  \ <Cmd>call ddu#ui#do_action('itemAction', {'name': 'newFile'})<CR>
  nnoremap <buffer> <C-l>
  \ <Cmd>call ddu#ui#do_action('redraw')<CR>
endfunction
nabezokodaikon commented 6 months ago

We apologize for the inconvenience. When I performed the following steps with that vimscript, it was reproduced.

  1. $ mkdir -p foo/bar
  2. $ cd foo
  3. $nvim
  4. Perform toggle operation on filer.
  5. Perform newFile operation with filer.
  6. Perform redraw operation with filer.

Thank you.

Shougo commented 6 months ago

Fixed. Please update ddu.vim.

nabezokodaikon commented 6 months ago

Thank you!