Shougo / ddu-ui-filer

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

After narrow, ddu-column-filename does not refrect #10

Closed otoyo closed 2 years ago

otoyo commented 2 years ago

Problems summary

After opening a directory by itemAction narrow, ddu-column-filename (such as + prefix) does not reflect.

Expected

directories

~/
 dir_a/  <- narrow here
  dir_b/
   hoge.txt

expected

file:~/dir_a
+ dir_b/
   hoge.txt

actual

file:~/dir_a
dir_b/
hoge.txt

Please see the screenshots.

Environment Information

neovim ``` NVIM v0.7.2 Build type: Release LuaJIT 2.1.0-beta3 Compiled by brew@Monterey Features: +acl +iconv +tui See ":help feature-compile" システム vimrc: "$VIM/sysinit.vim" 省略時の $VIM: "/usr/local/Cellar/neovim/0.7.2/share/nvim" Run :checkhealth for more info ```
Vim ``` VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 19 2022 21:41:43) macOS version - x86_64 Included patches: 1-4113 Compiled by root@apple.com Normal version without GUI. Features included (+) or not (-): +acl +channel +cscope +ex_extra -hangul_input +linebreak -mouse_dec -mzscheme -profile -sodium -tcl +user_commands +wildmenu -arabic +cindent +cursorbind +extra_search +iconv +lispindent -mouse_gpm +netbeans_intg -python -sound -termguicolors -vartabs +windows +autocmd -clientserver +cursorshape -farsi +insert_expand +listcmds -mouse_jsbterm +num64 -python3 +spell +terminal +vertsplit +writebackup +autochdir +clipboard +dialog_con +file_in_path +ipv6 +localmap -mouse_netterm +packages +quickfix +startuptime +terminfo +vim9script -X11 -autoservername +cmdline_compl +diff +find_in_path +job -lua +mouse_sgr +path_extra +reltime +statusline +termresponse +viminfo -xfontset -balloon_eval +cmdline_hist +digraphs +float +jumplist +menu -mouse_sysmouse -perl -rightleft -sun_workshop +textobjects +virtualedit -xim -balloon_eval_term +cmdline_info -dnd +folding -keymap +mksession -mouse_urxvt +persistent_undo +ruby/dyn +syntax +textprop +visual -xpm -browse +comments -ebcdic -footer +lambda +modify_fname +mouse_xterm +popupwin +scrollbind +tag_binary +timers +visualextra -xsmp +builtin_terms -conceal -emacs_tags +fork() -langmap +mouse +multi_byte +postscript +signs -tag_old_static +title +vreplace -xterm_clipboard +byte_offset +cryptv +eval -gettext +libcall -mouseshape +multi_lang +printer +smartindent -tag_any_white -toolbar +wildignore -xterm_save system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" defaults file: "$VIMRUNTIME/defaults.vim" fall-back for $VIM: "/usr/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X_UNIX -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -liconv -framework Coco ```

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

call plug#begin(stdpath('data') . '/plugged')
Plug 'vim-denops/denops.vim'
Plug 'Shougo/ddu.vim'
Plug 'Shougo/ddu-ui-ff'
Plug 'Shougo/ddu-ui-filer'
Plug 'Shougo/ddu-source-file'
Plug 'Shougo/ddu-kind-file'
Plug 'Shougo/ddu-column-filename'
call plug#end()

call ddu#custom#patch_local('filer', {
\   'ui': 'filer',
\   'sources': [
\     {
\       'name': 'file',
\       'params': {},
\     },
\   ],
\   'sourceOptions': {
\     '_': {
\       'columns': ['filename'],
\     },
\   },
\   'uiParams': {
\     'filer': {
\       'winWidth': 40,
\       'split': 'vertical',
\       'splitDirection': 'topleft',
\     }
\   },
\ })

autocmd FileType ddu-filer call s:ddu_filer_my_settings()
function! s:ddu_filer_my_settings() abort
  nnoremap <buffer><silent><expr> <CR>
    \ ddu#ui#filer#is_directory() ?
    \ "<Cmd>call ddu#ui#filer#do_action('itemAction', {'name': 'narrow'})<CR>" :
    \ "<Cmd>call ddu#ui#filer#do_action('itemAction', {'name': 'open', 'params': {'command': 'vsplit'}})<CR>"

  nnoremap <buffer><silent> q
    \ <Cmd>call ddu#ui#filer#do_action('quit')<CR>

  nnoremap <buffer><silent> ..
    \ <Cmd>call ddu#ui#filer#do_action('itemAction', {'name': 'narrow', 'params': {'path': '..'}})<CR>
endfunction

nmap <silent> ;d <Cmd>call ddu#start({
\   'name': 'filer',
\ })<CR>

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

  1. Open a file under some directories by neovim
  2. Open ddu-ui-filer by pressing ;d
  3. Press Enter on the any directory(narrow)

Screenshot (if possible)

Before narrow

スクリーンショット 2022-08-04 8 32 36

After narrow

スクリーンショット 2022-08-04 8 32 55

Shougo commented 2 years ago

Really? I will test it later.

Shougo commented 2 years ago

Reproduced.

Shougo commented 2 years ago

Please update ddu.vim.

otoyo commented 2 years ago

I updated ddu.vim. Thank you for the fix!