Shougo / ddu.vim

Dark deno-powered UI framework for Vim/NeoVim
MIT License
295 stars 24 forks source link

Cannot expand the tree from the beginning #56

Closed uga-rosa closed 1 year ago

uga-rosa commented 1 year ago

Problems summary

I would like to expand items from the beginning, but it doesn't work.

Expected

The tree structure is displayed correctly.

Environment Information

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

set runtimepath+=/path/to/denops.vim
set runtimepath+=/path/to/ddu.vim
set runtimepath+=/path/to/ddu-ui-ff
set runtimepath+=/path/to/ddu-kind-file

call ddu#custom#patch_global(#{
      \ sources: [#{ name: 'expand' }],
      \ ui: 'ff',
      \ uiParams: #{
      \   ff: #{
      \     displayTree: v:true,
      \   },
      \ },
      \})

augroup my-ddu-ff
  autocmd!
  autocmd FileType ddu-ff call <SID>ddu_ff_mapping()
augroup END

function! s:ddu_ff_mapping() abort
  nnoremap <buffer><silent> <Esc> <Cmd>call ddu#ui#do_action('quit')<CR>
endfunction

And place this source under stdpath('config').

type Params = Record<never, never>;

export class Source extends BaseSource { kind = "file";

gather(): ReadableStream<Item[]> { return new ReadableStream({ start(controller) { controller.enqueue([ { word: "foo", isTree: true, treePath: "/foo", isExpanded: true, }, { word: "bar", isTree: false, treePath: "/foo/bar", }, ]); controller.close(); }, }); }

params(): Params { return {}; } }



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

1. `call ddu#start({})`
2. You can already see that it's not a tree.

## Screenshot (if possible)
![image](https://github.com/Shougo/ddu.vim/assets/82267684/7c3cee10-b6e1-4a16-bb7e-2d42bd37d3d7)

## Upload the log messages by `:redir` and `:message` (if errored)
Shougo commented 1 year ago

Fixed. Please update ddu-ui-ff.

uga-rosa commented 1 year ago

Not fixed. The bar is not a child of foo. It is placed directly under root.

uga-rosa commented 1 year ago

I have confirmed the correction of the attribute-level. This issue has been resolved.