Giter Club home page Giter Club logo

Comments (3)

echasnovski avatar echasnovski commented on September 15, 2024

Thanks for the suggestion!

I am afraid, I'd like to avoid exporting too much from 'mini.git' (or any modules, for that matter). It can get convoluted pretty quickly.

I was hoping that vim.api.nvim_get_commands({}) can return both complete function and command implementation, but sadly (and confusingly) it does not 😞

Currently my best suggestion for command_impl replacement would be to manually construct command string and use vim.cmd('Git ...') explicitly.

And as for command_complete()... I don't have any even remotely useful suggestions. Maybe try using string complete field from :h command-complete (like 'file_in_path' with adjusted 'path' option) or implement from scratch for most important for you cases.

Making completion support custom flags in this exact command (like --git-dir) is also non-trivial under current design.

I maybe ponder a bit over this, but I don't have high hopes for this.

from mini.nvim.

ibhagwan avatar ibhagwan commented on September 15, 2024

I was hoping that vim.api.nvim_get_commands({}) can return both complete function and command implementation, but sadly (and confusingly) it does not

I also looked at that but it only gives a reference to the complete function, it also requires iterating all commands as there is no vim.api.nvim_get_command for a single command

Currently my best suggestion for command_impl replacement would be to manually construct command string and use vim.cmd('Git ...') explicitly.

I thought about that too, perhaps with abbrev but I dislike this solution, it also feels less robust, not enough to warrant replacing the trusty vim-fugitive.

Making completion support custom flags in this exact command (like --git-dir) is also non-trivial under current design.
I maybe ponder a bit over this, but I don't have high hopes for this.

Fair enough, I guess we can close this issue unless you need more pondering time :)

from mini.nvim.

echasnovski avatar echasnovski commented on September 15, 2024

I also looked at that but it only gives a reference to the complete function, it also requires iterating all commands as there is no vim.api.nvim_get_command for a single commons.

It's a map (which is also not very consistent with other API methods). So it would be like vim.api.nvim_get_commands({}).Git.

Making completion support custom flags in this exact command (like --git-dir) is also non-trivial under current design.
I maybe ponder a bit over this, but I don't have high hopes for this.

Fair enough, I guess we can close this issue unless you need more pondering time :)

Yes, let's keep this open for a bit. You never know.

from mini.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.