Shougo / ddu-ui-filer

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

Strange (unexpected) behavior If specify 'topleft' to splitDirection #33

Closed ryota2357 closed 1 year ago

ryota2357 commented 1 year ago

Problems summary

If I specify splitDirection: 'topleft', several unexpected behaviors occur (please see reproduce section).

Expected

Works same as splitDirection: 'belowright'

Environment Information

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

if !has("nvim")
  set nocompatible
  filetype plugin indent on
  syntax enable
endif

let s:plugins = [
      \ 'vim-denops/denops.vim',
      \ 'Shougo/ddu.vim',
      \ 'Shougo/ddu-ui-filer',
      \ 'ryota2357/ddu-column-icon_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'}],
    \   sourceOptions: #{
    \     _: { 'columns': ['icon_filename'] }
    \   },
    \   uiOptions: #{
    \     _: #{ toggle: v:true }
    \   },
    \   uiParams: #{
    \     _: #{ splitDirection: 'topleft' }
    \   },
    \   kindOptions: #{
    \     file: #{
    \       defaultAction: 'open',
    \     },
    \   }
    \ })

autocmd FileType ddu-filer call s:ddu_my_settings()
function! s:ddu_my_settings() abort
  nnoremap <buffer><CR> <Cmd>call ddu#ui#sync_action('itemAction')<CR>
  nnoremap <buffer>o    <Cmd>call ddu#ui#async_action('itemAction', #{ params: #{ command: 'tab drop' } })<CR>
endfunction

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

toggle does not works.

https://github.com/Shougo/ddu-ui-filer/assets/61523777/049d47d9-f04b-47f7-81ea-cfddf3ddeeeb

open with tab drop

https://github.com/Shougo/ddu-ui-filer/assets/61523777/7311126e-e6ec-4f00-8284-020e8a29b670

Shougo commented 1 year ago

Reproduced. close {winid} seems broken. I don't know why it does not work.

You can test by close {winid} manually.

Shougo commented 1 year ago

Fixed.