-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cmdline completions #323
Cmdline completions #323
Conversation
What's the purpose of sources = {
editor/cmdline = {
enabled_providers = { "cmdline" },
},
}, and not something like (I think this is more ergonomic) sources = {
editor/cmdline = { "cmdline" },
}, This might be a more personal preference, but I think its okay to have |
Motivation was I wanted to leave space for mode specific properties, but I might end up doing that a bit differently. Tbh I don't like either |
Thanks for this feature. |
@ratheesh That's out of scope for this PR but eventually the plugin will be extensible enough that you could write this yourself if you like |
Sweeping refactor of the codebase touching just about everything: reworked config with validation, trigger, new list component for managing state, stateless windows, etc. This will set us up for cmdline completions (#323), sources v3 (keywords, async, fallback tree, ...), and documentation. After which, we can hopefully release v1
62f8222
to
b20184f
Compare
@folke I've added an API For now, users can do this themselves via: completion.menu.cmdline_position = function()
local screenpos = require('noice.api').get_cmdline_position().screenpos
return { screenpos.row - 1, screenpos.col - 1 }
end |
@Saghen I'm willing to add something for this, but it's probably easier if you add it in blink directly? You can just check for That api, just returns a copy of a table, so there's no processing of any kind involved. |
@folke My thinking was plugin authors could integrate with blink without having to make a PR. And it lowers the maintenance burden on blink's side, on new plugins or when a supported plugin has breaking changes. But I'm open to putting this in blink directly if you think that's best. Btw, not sure if this is what you mean, but you could probably set just on CmdlineEnter, not on every render |
I made it easier. Noice now sets The screen position is This would make it also easier for other plugins that want to integrate with blink. They just need to set that global. |
That's even better, thank you! |
Looks like noice's cmdline pos was actually I also wanted the global to be Can you make a small update to your code to support both formats and then let me know, so I can switch to the Otherwise blink/noice would break for users. Ty! |
Also, really cool the new cmdline completions! |
I've switched it to use the new |
Great, also changed on the noice side. ty! |
is it possible to keep expanding "%" to the current file path when pressing tab? Repro steps:
I tried changing |
Adds a new
cmdline
source based on https://github.com/hrsh7th/cmp-cmdline andsources.cmdline
for configuring cmdline sourcesCloses #138