-
Notifications
You must be signed in to change notification settings - Fork 746
feat!(selection): do not display hint immediately #2536
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
Conversation
200a4cd to
055c8b7
Compare
|
@yetone it looks like the errors are coming from luvit-meta which is set in dependencies and which defines uv.new_timer() as returning uv_timer_t and not uv.uv_timer_t as luals does. Why do we need this package in dependencies? |
|
@yetone I see, however they luals and luvit-meta are not supposed to be used together as they conflict. Kickstart used to use libuvt-meta (but not luals 3rd library), but they switched in nvim-lua/kickstart.nvim#1303 and lazydev made similar switch earlier. We should pick one, but not both. |
As discussed in yetone#2536 the project should either use luv bindings from luals or luvit-meta library, but not both, as they conflict with each other (especially with uv.uv_timer_t). Given that other projects such as kickstart.nvim and lazydev.nvim are switching to use the former, we should do the same and drop luvit-meta dependency.
As discussed in yetone#2536 the project should either use luv bindings from luals or luvit-meta library, but not both, as they conflict with each other (especially with uv.uv_timer_t). Given that other projects such as kickstart.nvim and lazydev.nvim are switching to use the former, we should do the same and drop luvit-meta dependency. Also adjust code that was using luvit-meta's annotations for timers.
As discussed in #2536 the project should either use luv bindings from luals or luvit-meta library, but not both, as they conflict with each other (especially with uv.uv_timer_t). Given that other projects such as kickstart.nvim and lazydev.nvim are switching to use the former, we should do the same and drop luvit-meta dependency. Also adjust code that was using luvit-meta's annotations for timers.
|
Is this ready to be merged? |
|
It passes the checks but I would like to hear your opinion on the fact that it is a breaking change that will affect users who modified their configs... I do not expect many would disable the ability to select code and invoke avante. |
|
Will this affect the existing users' inability to display the hint window? I feel that the default configuration's delay is an acceptable delay.
|
Selection hint that is displayed immediately upon entering visual mode
([<leader>aa: ask, <leader>ae: edit]) gets old pretty quickly. Add a
config option to control when the hint is displayed:
selection = {
enabled = true,
hint_display = "delayed",
},
The "hint_display" option recognizes the following values:
- "immediate" results in the hint being shown immediately after entering
visual mode. This is the old behavior.
- "delayed" causes the hint be displayed only if the cursor has not been
moved for vim.o.updatetime milliseconds. This is the new default.
- "none" suppresses showing the hint completely.
Unfortunately "CursorHold" event is not emitted in visual mode so we
have to emulate it using Utils.debounce().
This is a breaking change because selection behavior was controller by
"hints" config entry which makes little sense, so the config section and
associated commands were renamed to "selection".
Additionally the "hints"/"selection" was mapped to "<leader>ah", but the
very same key combination was used to select from old Avante chat
histories, which overrode the toggle. New selection toggle keymap is
"<leader>aC".
|
LGTM |
Selection hint that is displayed immediately upon entering visual mode ([aa: ask, ae: edit]) gets old pretty quickly. Add a config option to control when the hint is displayed:
selection = {
enabled = true,
hint_display = "delayed",
},
The "hint_display" option recognizes the following values:
Unfortunately "CursorHold" event is not emitted in visual mode so we have to emulate it using Utils.debounce().
This is a breaking change because selection behavior was controller by "hints" config entry which makes little sense, so the config section and associated commands were renamed to "selection".
Additionally the "hints"/"selection" was mapped to "ah", but the very same key combination was used to select from old Avante chat histories, which overrode the toggle. New selection toggle keymap is "aC".