Shougo / ddu-kind-file

File kind for ddu.vim
MIT License
25 stars 9 forks source link

cannot delete/trash file #9

Closed mikanIchinose closed 1 year ago

mikanIchinose commented 1 year ago

minimal setting

set runtimepath^=path/to/ddu.vim
set runtimepath^=path/to/ddu-ui-ff
set runtimepath^=path/to/ddu-source-file_rec
set runtimepath^=path/to/ddu-kind-file

augroup Ddu
  autocmd!
  autocmd FileType ddu-ff nnoremap <buffer> d <Cmd>call ddu#ui#ff#do_action('itemAction', {'name': 'delete'})<CR>
augroup END

call ddu#custom#patch_global({
      \ 'sources': [{'name': 'file_rec'}],
      \ 'ui': 'ff',
      \ })

instruction

  1. start vim
  2. :call ddu#start()
  3. move cursor file that I will delete
  4. press d
  5. show error message

https://user-images.githubusercontent.com/29175998/204100519-a34f7dbb-65c7-4ae7-b7dc-59b63bddbae2.mov

error message

Error detected while processing function ddu#ui#ff#do_action[13]..ddu#ui_action[1]..ddu#_request[22]..denops#request[1]..denops#server#request[6]..<SNR>27_request:                                                                   
line    1:
Error invoking 'invoke' on channel 4:
Error: Failed to call 'uiAction' with ["default","itemAction",{"name":"delete"}]: Error: Failed to call 'call' with ["ddu#item_action","default","delete",[{"word":"tmp","action":{"path":"/Users/solenoid/LocalProject/neovim_minimal/tmp","isD
irectory":false},"kind":"file","matcherKey":"tmp","__sourceIndex":0,"__sourceName":"file_rec","__level":0,"__expanded":false}],{}]: Error: Failed to call 'nvim_call_function' with ["ddu#item_action",["default","delete",[{"word":"tmp","actio
n":{"path":"/Users/solenoid/LocalProject/neovim_minimal/tmp","isDirectory":false},"kind":"file","matcherKey":"tmp","__sourceIndex":0,"__sourceName":"file_rec","__level":0,"__expanded":false}],{}]]: [0,"Vim(return):Error invoking 'invoke' on
 channel 4:\nError: Failed to call 'itemAction' with [\"default\",\"delete\",[{\"word\":\"tmp\",\"__sourceName\":\"file_rec\",\"action\":{\"path\":\"/Users/solenoid/LocalProject/neovim_minimal/tmp\",\"isDirectory\":false},\"__level\":0,\"ki
nd\":\"file\",\"__expanded\":false,\"matcherKey\":\"tmp\",\"__sourceIndex\":0}],{}]: Error: Failed to call 'call' with [\"ddu#kind#file#confirm\",\"Are you sure you want to delete /Users/solenoid/LocalProject/neovim_minimal/tmp?\",\"&Yes\\n
&No\\n&Cancel\",2]: Error: Failed to call 'nvim_call_function' with [\"ddu#kind#file#confirm\",[\"Are you sure you want to delete /Users/solenoid/LocalProject/neovim_minimal/tmp?\",\"&Yes\\n&No\\n&Cancel\",2]]: [0,\"Vim:E117: Unknown functi
on: ddu#kind#file#confirm\"]\n    at Session.call (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:207:13)\n    at async Session.call (file:///Users/solenoid/.cache/dein/repos/github.com/vim-denops/denops.vim/denops/@denops-private/servic
e.ts:170:14)\n    at async Session.dispatch (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:99:12)\n    at async https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:108:18\n    at async Session.handleRequest (https://deno.land/x/msgpack_rp
c@v3.1.6/session.ts:104:29)\n    at Session.call (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:207:13)\n    at async DenopsImpl.call (file:///Users/solenoid/.cache/dein/repos/github.com/vim-denops/denops.vim/denops/@denops/impl.ts:34:1
2)\n    at async delete (file:///Users/solenoid/.cache/dein/repos/github.com/Shougo/ddu-kind-file/denops/@ddu-kinds/file.ts:111:23)\n    at async Ddu.itemAction (file:///Users/solenoid/.cache/dein/repos/github.com/Shougo/ddu.vim/denops/ddu/
ddu.ts:735:19)\n    at async Session.itemAction (file:///Users/solenoid/.cache/dein/repos/github.com/Shougo/ddu.vim/denops/ddu/app.ts:247:7)\n    at async Session.dispatch (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:99:12)\n    at as
ync https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:108:18\n    at async Session.handleRequest (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:104:29)\n    at Session.call (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:207:13)\n   
 at async Service.dispatch (file:///Users/solenoid/.cache/dein/repos/github.com/vim-denops/denops.vim/denops/@denops-private/service.ts:124:14)\n    at async Session.invoke (file:///Users/solenoid/.cache/dein/repos/github.com/vim-denops/den
ops.vim/denops/@denops-private/host/nvim.ts:53:16)\n    at async Session.dispatch (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:99:12)\n    at async https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:108:18\n    at async Session.handleR
equest (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:104:29)"]
    at Session.call (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:207:13)
    at async Session.call (file:///Users/solenoid/.cache/dein/repos/github.com/vim-denops/denops.vim/denops/@denops-private/service.ts:170:14)
    at async Session.dispatch (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:99:12)
    at async https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:108:18
    at async Session.handleRequest (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:104:29)
    at Session.call (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:207:13)
    at async DenopsImpl.call (file:///Users/solenoid/.cache/dein/repos/github.com/vim-denops/denops.vim/denops/@denops/impl.ts:34:12)
    at async itemAction (file:///Users/solenoid/.cache/dein/repos/github.com/Shougo/ddu-ui-ff/denops/@ddu-uis/ff.ts:592:7)
    at async Ddu.uiAction (file:///Users/solenoid/.cache/dein/repos/github.com/Shougo/ddu.vim/denops/ddu/ddu.ts:550:19)
    at async Session.uiAction (file:///Users/solenoid/.cache/dein/repos/github.com/Shougo/ddu.vim/denops/ddu/app.ts:233:7)
    at async Session.dispatch (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:99:12)
    at async https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:108:18
    at async Session.handleRequest (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:104:29)
    at Session.call (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:207:13)
    at async Service.dispatch (file:///Users/solenoid/.cache/dein/repos/github.com/vim-denops/denops.vim/denops/@denops-private/service.ts:124:14)
    at async Session.invoke (file:///Users/solenoid/.cache/dein/repos/github.com/vim-denops/denops.vim/denops/@denops-private/host/nvim.ts:53:16)
    at async Session.dispatch (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:99:12)
    at async https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:108:18
    at async Session.handleRequest (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:104:29)
Shougo commented 1 year ago

Fixed.

mikanIchinose commented 1 year ago

Thank you šŸ™šŸ»