aboutsummaryrefslogtreecommitdiffstats
path: root/commands/menu.go
Commit message (Collapse)AuthorAgeFilesLines
* completion: add command option descriptionsRobin Jarry3 days1-6/+6
| | | | | | | | | | | | | Add `desc:""` struct field tags in all command arguments where it makes sense. The description values will be returned along with completion choices. Implements: https://todo.sr.ht/~rjarry/aerc/271 Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bojan Gabric <bojan@bojangabric.com> Tested-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* completion: add commands descriptionsRobin Jarry3 days1-0/+4
| | | | | | | | | | | | | | | Update the Command interface to include a Description() method. Implement the method for all commands using short descriptions inspired from the aerc(1) man page. Return the description values along with command names so that they can be displayed in completion choices. Implements: https://todo.sr.ht/~rjarry/aerc/271 Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bojan Gabric <bojan@bojangabric.com> Tested-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* completion: display descriptions next to choicesRobin Jarry3 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Use go-opt v2 new completion API which returns items descriptions along with their text values. Display the descriptions after the items separated by two spaces. Wrap the descriptions in parentheses to better indicate that they are not part of the completion choices. Limit the description length to 80 characters to avoid display issues. Add a new style object completion_description in stylesets. By default, the object will be rendered with a dimmed terminal attribute. Update all stylesets and documentation accordingly. Implements: https://todo.sr.ht/~rjarry/aerc/271 Link: https://git.sr.ht/~rjarry/go-opt/commit/ebeb82538395a Changelog-added: Command completion now displays descriptions next to completion items. Changelog-added: New `completion_description` style object in style sets used for rendering completion item descriptions. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bojan Gabric <bojan@bojangabric.com> Tested-by: Jason Cox <me@jasoncarloscox.com> Acked-by: Tim Culverhouse <tim@timculverhouse.com>
* log: move package to libRobin Jarry2024-02-141-1/+1
| | | | | | | This has nothing to do at the root of the source tree. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Bence Ferdinandy <bence@ferdinandy.com>
* menu: use listbox as fallback commandKoni Marti2024-01-291-27/+76
| | | | | | | | | | | | Implement the listbox widget as fallback picker when no command to :menu was specified or the command cannot be found in PATH. The listbox will also be used with "-" as the shell command: :menu -c "-" -d :cf Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* app: define two dialog constructorsKoni Marti2024-01-291-9/+1
| | | | | | | | | | | | | Define two new constructor functions for the popup dialog. DefaultDialog() creates a dialog that spans half of the screen, whereas the LargeDialog() covers three-quarter of the screen. If a dialog widget has more specific size requirements, custom window position and window height functions can be used with NewDialog(). Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* commands: add menuRobin Jarry2024-01-201-0/+187
Add a new :menu command that can be used to spawn a shell command in an interactive dialog and execute aerc commands for each of the lines printed on its standard output like xargs(1) would do in a shell. The shell command can be configured in aerc.conf under [general].default-menu-cmd and overridden via the :menu -c <cmd> option. There are two flags to provide input text to the shell command which can be useful in combination with other aerc commands: -a: All account names, one per line: '<account>' LF -d: All current account directory names, one per line: '<directory>' LF -ad: All directories of all accounts, one per line: '<account>' '<directory>' LF Here are some examples: :menu -adc fzf :cf -a :menu -c 'fzf --multi' :attach :menu -dc 'fzf --multi' :cp And also for key bindings: <C-p> = :menu -adc fzf :cf -a<Enter> Changelog-added: New `:menu` command to invoke other aerc commands based on a shell command output. Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Tested-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>