File kind for ddu.vim

Overview
Comments
  • Location list support

    Location list support

    Sometime back I submitted a pull-request which added location-list support for denite. I've started making the same update for ddu in a commit located at https://github.com/jrudess/ddu-kind-file/commit/613bd03f9d3f459dbfe1ae09680bf2c4da4fc555

    With Denite, I retrieved the window number using the following API:

      wininfo = self._vim.call('denite#helper#_get_wininfo')
      self.vim.call('setloclist', wininfo['winnr'], qfloclist)
    

    Do you have a similar API for ddu? For now I've just got a hard-coded constant buffer number.

      // TODO: Need correct buffer number
      const winnr = await fn.bufwinnr(args.denops, 1);
      await fn.setloclist(args.denops, winnr, qfloclist, " ");
    
    opened by jrudess 3
  • cannot delete/trash file

    cannot delete/trash file

    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/[email protected]/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/[email protected]/session.ts:99:12)\n    at async https://deno.land/x/[email protected]/session.ts:108:18\n    at async Session.handleRequest (https://deno.land/x/msgpack_rp
    [email protected]/session.ts:104:29)\n    at Session.call (https://deno.land/x/[email protected]/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/[email protected]/session.ts:99:12)\n    at as
    ync https://deno.land/x/[email protected]/session.ts:108:18\n    at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)\n    at Session.call (https://deno.land/x/[email protected]/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/[email protected]/session.ts:99:12)\n    at async https://deno.land/x/[email protected]/session.ts:108:18\n    at async Session.handleR
    equest (https://deno.land/x/[email protected]/session.ts:104:29)"]
        at Session.call (https://deno.land/x/[email protected]/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/[email protected]/session.ts:99:12)
        at async https://deno.land/x/[email protected]/session.ts:108:18
        at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
        at Session.call (https://deno.land/x/[email protected]/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/[email protected]/session.ts:99:12)
        at async https://deno.land/x/[email protected]/session.ts:108:18
        at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
        at Session.call (https://deno.land/x/[email protected]/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/[email protected]/session.ts:99:12)
        at async https://deno.land/x/[email protected]/session.ts:108:18
        at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
    
    opened by mikanIchinose 2
  • Odd behavior with filer

    Odd behavior with filer

    Problems summary

    newFile, rename, trash are breaks tree-view.

    Please see the below movie.

    https://user-images.githubusercontent.com/61523777/202909546-d6ce34c1-8630-4e9b-8721-0249b4744d96.mov

    1. Start ddu.
    2. Create new file hoge/fuga/bar.txt with newFile
    3. Delete hoge/fuga/bar.txt with trash
    4. Rename hoge/fuga/foo.txt to hoge/fuga/foo1.txt with rename

    Expected

    Does not breaks the tree-view.

    Environment Information

    :version
    NVIM v0.8.1
    Build type: Release
    LuaJIT 2.1.0-beta3
    Compiled by [email protected]
    
    Features: +acl +iconv +tui
    See ":help feature-compile"
    
          システム vimrc: "$VIM/sysinit.vim"
           省略時の $VIM: "/opt/homebrew/Cellar/neovim/0.8.1/share/nvim"
    
    Run :checkhealth for more info
    
    • macOS 13.0.1
    • All plugins are up-to-date.

    Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

    let s:plugins = [
          \ 'vim-denops/denops.vim',
          \ 'Shougo/ddu.vim',
          \ 'Shougo/ddu-ui-filer',
          \ 'ryota2357/ddu-column-icon_filename',
          \ 'Shougo/ddu-column-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', 'params': {}}],
        \   'resume': v:true,
        \   'sourceOptions': {
        \     '_': {
        \       'columns': ['icon_filename'],
        \     },
        \   },
        \   'kindOptions': {
        \     'file': {
        \       'defaultAction': 'open',
        \     },
        \   }
        \ })
    
    autocmd FileType ddu-filer call s:ddu_my_settings()
    function! s:ddu_my_settings() abort
      nnoremap <buffer><expr><silent><CR> ddu#ui#filer#is_tree()
        \ ? "<Cmd>call ddu#ui#filer#do_action('expandItem', {'mode': 'toggle'})<CR>"
        \ : "<Cmd>call ddu#ui#filer#do_action('itemAction')<CR>"
      nnoremap <buffer><silent> q <Cmd>call ddu#ui#filer#do_action('quit')<CR>
      nnoremap <buffer> n <Cmd>call ddu#ui#filer#do_action('itemAction', { 'name': 'newFile' })<CR>
      nnoremap <buffer> r <Cmd>call ddu#ui#filer#do_action('itemAction', { 'name': 'rename' })<CR>
      nnoremap <buffer> d <Cmd>call ddu#ui#filer#do_action('itemAction', { 'name': 'trash' })<CR>
    endfunction
    

    In the movie, I use icon_filename for ddu-column, but the same problem occurs with filename

    opened by ryota2357 2
  • newFile action end with /, create directory

    newFile action end with /, create directory

    If newFile action input ends with "/", create new directory instead of new file. This behavior is the same as new_file of defx.nvim

    try to create new file which ends with "/", error is occurred.

    opened by ryota2357 1
  • fix error when passing empty array to previewCmds

    fix error when passing empty array to previewCmds

    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]..<SNR>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/[email protected]/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/[email protected]/session.ts:99:12)
        at async https://deno.land/x/[email protected]/session.ts:108:18
        at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
        at Session.call (https://deno.land/x/[email protected]/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/[email protected]/session.ts:99:12)
        at async https://deno.land/x/[email protected]/session.ts:108:18
        at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
        at Session.call (https://deno.land/x/[email protected]/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/[email protected]/session.ts:99:12)
        at async https://deno.land/x/[email protected]/session.ts:108:18
        at async Session.handleRequest (https://deno.land/x/[email protected]/session.ts:104:29)
    
    opened by erw7 0
Owner
Shougo
The text editor is the world.
Shougo
Custom list source for ddu.vim

ddu-source-custom-list Custom list source for ddu.vim This souce allows you to specify custom text list as a ddu source programatically. Configuration

Iizuka Masashi 5 Dec 28, 2022
Line source for ddu.vim

ddu-source-line Line source for ddu.vim This source collects current buffer lines. Required denops.vim https://github.com/vim-denops/denops.vim ddu.vi

Shougo 8 Dec 11, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM deffiniation and appropriate file structure.

Welcome to function-stencil ?? A quickstart AWS Lambda function code generator. Downloads a template function code file, test harness file, sample SAM

Ben Smith 21 Jun 20, 2022
Serve file server with single zip file as file system in Deno.

zipland Serve file server with one-single zip file in Deno. Support zip just zip32 with deflated or uncompressed serving plaintext deflate Examples Yo

Yongwook Choi 18 Nov 2, 2022
Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

Hacktoberfest Indonesia Apa Itu Hacktoberfest ? Hacktoberfest adalah acara tahunan yang bertujuan untuk mendorong berkontribusi kedalam ekosistem open

Juan Daniel 5 Dec 15, 2022
Homepage of the Vim Inspired Electron Browser - Vieb

vieb.dev Vieb is the Vim Inspired Electron Browser. This repo contains the full source code of Vieb's website/homepage. This does not contain the sour

Jelmer van Arnhem 5 Dec 15, 2022
💻 ssher.vim is interacting remote machines(only linux) through ssh connection

?? ssher.vim is interacting remote machines(only linux) through ssh connection

Luma 3 Feb 21, 2022
Experimental keycast plugin for Vim/Neovim

vim-keycasty Introduction Keycasty is an experimental keycast plugin for Vim/Neovim. Still work in progress. Use it just for testing. Design Keycasty

Shun Ueda 4 Apr 30, 2022
GitHub completion for ddc.vim via gh

ddc-github GitHub completion for ddc.vim via gh These sources collect something related to GitHub (e.g. issues, pull requests) via gh, which is GitHub

Hibiki 11 Oct 18, 2022
Do you wanna watch "Bad Apple!!" on your vim/neovim?

bad-apple.vim Let's watch Bad Apple!! on your vim/neovim! BadAppleVimShort.mov https://youtu.be/XezoLvr1dX0 Required denops.vim https://github.com/vim

Ryotaro 14 Dec 28, 2022
GraphQL client for Vim/Neovim

denops-graphql.vim GraphQL client for Vim/Neovim. Requirements denops.vim Usage :GraphQLExecute Execute current buffer as graphql query. :GraphQLEdit

skanehira 10 Dec 15, 2022
Vim/Neovim plugin for Kubernetes

k8s.vim A Vim/Neovim plugin for kubernetes Requirements denops.vim kubectl Usage " Execute kubectl via terminal " Bellow is Same as 'kubectl get pods

skanehira 19 Oct 7, 2022
Copilot completion for ddc.vim

ddc-copilot Copilot completion for ddc.vim NOTE: It is experimental source. Required copilot.vim https://github.com/github/copilot.vim denops.vim http

Shougo 3 Oct 27, 2022
Generate random ethereum wallets & private keys and then check if they match a wallet that contains some kind of balance, so that you can take it. In Node.js

Ethereum-Stealer Generate random ethereum wallets & private keys and then check if they match a wallet that contains some kind of balance, so that you

Michał 74 Dec 24, 2022
A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

A free and open source resume builder. Go to App What is this app all about? Reactive Resume is a free and open source resume builder that’s built to

Reactive Resume 9.7k Jan 3, 2023
Nest multiple blocks inside lists of any kind of list (ordered, unordered, no marker, etc), or do away with list markers and use it like a repeater!

Nest multiple blocks inside lists of any kind of list (ordered, unordered, no marker, etc), or do away with list markers and use it like a repeater!

Rani 15 Dec 26, 2022