Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support display-only information in place of a suffix
Group headings are also display-only information, but this commit enables displaying such information anywhere in the layout where a suffix can appear. By inheriting from `transient-suffix' (instead of `transient-child') we avoid having to implement many new methods and/or adding special- cases to existing methods, but semantically this is questionable. Setting the `command' slot to nil, instead of leaving it unbound also avoids lots of special-cases. As does setting `key' to " ", which does not conflict with any real suffix binding for "SPC", because display-only children are only used in the layout; they are filtered out by `transient--flatten-suffixes' before any keymaps are populated. Still, using the name `key' is a misnomer in this case. It also means that a few functions that perform additional work based on the used key, need to ignore these fake keys, namely `transient--init-suffix' and `transient-format-description'. Additionally `transient--init-suffix' is taught that display-only children don't have an associated command. `transient--parse-suffix' needs to support the syntax for display- only children, which is (:info DESCRIPTION [KEYWORD VALUE...]), where DESCRIPTION may be a string or a function. Closes #226.
- Loading branch information