Shougo / ddu-ui-filer

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

The action "narrow" does not change the source path #36

Closed kenji0923 closed 9 months ago

kenji0923 commented 9 months ago

Problems summary

The action "narrow" on the selected item does not change the source path. I confirmed that at the line 307 of denops/@ddu-kinds/file.ts changed the variable args.sourceOption.path is modified by the "narrow" action. I also checked another trial by giving .. to a key path of the params dictionary, but it neither did not change the source path to the parent directory. Thanks in advance.

Expected

The source path is narrowed to a selected item.

Environment Information

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

.vimrc

set nocompatible

set runtimepath^=~/.cache/dpp/repos/github.com/vim-denops/denops.vim/
set runtimepath^=~/.cache/dpp/repos/github.com/Shougo/ddu.vim/
set runtimepath^=~/.cache/dpp/repos/github.com/Shougo/ddu-ui-filer/
set runtimepath^=~/.cache/dpp/repos/github.com/Shougo/ddu-kind-file/
set runtimepath^=~/.cache/dpp/repos/github.com/Shougo/ddu-source-file/
set runtimepath^=~/.cache/dpp/repos/github.com/Shougo/ddu-column-filename/

if has('syntax')
    syntax on
endif

call ddu#custom#patch_global({
        \       "ui": "filer",
        \       "sources": ["file"],
        \       "sourceOptions": {
        \           "file": {
        \               "columns": ["filename"],
        \           },
        \       },
        \ })

function s:ddu_filer_settings() abort
        nnoremap <buffer><silent><expr> <CR>
                \ ddu#ui#get_item()->get('isTree', v:false) ?
                \ "<Cmd>call ddu#ui#do_action('itemAction', { 'name': 'narrow' })<CR>" :
                \ "<Cmd>call ddu#ui#do_action('itemAction', { 'name': 'open' })<CR>"
endfunction

autocmd FileType ddu-filer call s:ddu_filer_settings()

command! DduFiler call ddu#start()

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

  1. vim
  2. :DduFiler
  3. 2j
  4. <CR>

Screenshot (if possible)

Before calling the action "narrow" on the child_directory/

before_narrow

After calling the action

after_narrow
Shougo commented 9 months ago

Fixed.

Please update ddu.vim.

kenji0923 commented 9 months ago

Thank you. It works!