Shougo / ddu-kind-file

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

fix error when passing empty array to previewCmds #6

Closed erw7 closed 2 years ago

erw7 commented 2 years ago

An error occurs when an empty array is passed to previewCmds as shown below. I feel that passing an empty array is a problem, but it is better to try to ignore it.

call ddu#ui#ff#do_action('preview', {'previewCmds' : [], })
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]..30_request: line 1: Error invoking 'invoke' on channel 4: Error: Failed to call 'uiAction' with ["default","preview",{"previewCmds":[]}]: Error: Failed to call 'call' with ["termopen",[]]: Error: Failed to call 'nvim_call_function' with ["termopen",[[]]]: [0,"Vim:E474: Invalid argument"] at Session.call (https://deno.land/x/msgpack_rpc@v3.1.6/session.ts:207:13) at async Service.call (file:///home/erw7/.config/nvim/dein/repos/github.com/vim-denops/denops.vim/denops/@denops-private/service.ts:92:12) at async Session.call (file:///home/erw7/.config/nvim/dein/repos/github.com/vim-denops/denops.vim/denops/@denops-private/service.ts:141: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:///home/erw7/.config/nvim/dein/repos/github.com/vim-denops/denops.vim/denops/@denops/impl.ts:28:12) at async PreviewUi.previewTerminal (file:///home/erw7/src/github.com/Shougo/ddu-ui-ff/denops/@ddu-ui-ff/preview.ts:152:7) at async PreviewUi.preview (file:///home/erw7/src/github.com/Shougo/ddu-ui-ff/denops/@ddu-ui-ff/preview.ts:98:14) at async Ddu.uiAction (file:///home/erw7/.config/nvim/dein/repos/github.com/Shougo/ddu.vim/denops/ddu/ddu.ts:394:19) at async Session.uiAction (file:///home/erw7/.config/nvim/dein/repos/github.com/Shougo/ddu.vim/denops/ddu/app.ts:206: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:///home/erw7/.config/nvim/dein/repos/github.com/vim-denops/denops.vim/denops/@denops-private/service.ts:107:14) at async Session.invoke (file:///home/erw7/.config/nvim/dein/repos/github.com/vim-denops/denops.vim/denops/@denops-private/host/nvim.ts:48: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) ```