feat(todos): route fast-access through ui.menu.handler#1167
Open
seflue wants to merge 1 commit into
Open
Conversation
The fast-access TODO prompt echoed its keys straight to the message area, so UI plugins could not theme or relocate it. With noice or snacks notifier it times out before you can read it. It now goes through ui.menu.handler when one is set, the same path the agenda menu uses; without a handler the echo output is unchanged. The menu data keeps the keyword sequences grouped and carries each keyword's highlight group, and exposes a stable kind, so a handler can render the cycles in their own colors. items stays as the flat view for handlers that ignore grouping.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fast-access prompt writes its keys straight to the message area with
nvim_echo, and there is no hook a UI plugin can use to take it over. This routes it throughui.menu.handlerwhen one is configured, the same path the agenda menu already uses, so a plugin like org-modern.nvim can render it. Each keyword becomes a menu option keyed by its shortcut, plus a space option to clear it. With no handler set the prompt keeps the existingnvim_echooutput, so the default look does not change.The menu data keeps the structure so a handler can use it: keywords are grouped by sequence (
groups, a list of option lists), each option carries its highlight group (hl), and the menu has a stablekind(todo_fast_access) to branch on.itemsstays as the flat view for handlers that ignore grouping, and the built-in echo menu is unchanged.A matching org-modern change renders these groups as a colored matrix (commit on my fork).
A handler must return the result of the selected action, since fast-access uses it to get the chosen keyword back. Menus whose actions only have side effects never needed this, so a handler that does not return will silently no-op here until it adds the
return.