diff options
author | Robin Jarry <robin@jarry.cc> | 2024-10-12 00:21:44 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2024-10-23 10:22:51 +0200 |
commit | 3c9ad93801ce9bb71d76fa398d7d94f1afd2c2cb (patch) | |
tree | dcc715e090fedf65e2b0f800d4d969b4606f7a5c /stylesets | |
parent | 63db443949b92eed5f5d2ded5f430bda96312b43 (diff) | |
download | aerc-3c9ad93801ce9bb71d76fa398d7d94f1afd2c2cb.tar.gz |
completion: display descriptions next to choices
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>
Diffstat (limited to 'stylesets')
-rw-r--r-- | stylesets/blue | 3 | ||||
-rw-r--r-- | stylesets/default | 4 | ||||
-rw-r--r-- | stylesets/monochrome | 1 | ||||
-rw-r--r-- | stylesets/nord | 1 | ||||
-rw-r--r-- | stylesets/pink | 3 | ||||
-rw-r--r-- | stylesets/solarized | 1 |
6 files changed, 10 insertions, 3 deletions
diff --git a/stylesets/blue b/stylesets/blue index 4fffca0a..7c1169fb 100644 --- a/stylesets/blue +++ b/stylesets/blue @@ -43,7 +43,6 @@ part_*.selected.fg=#ffffff part_*.selected.bg=#005f87 part_filename.selected.bold=true -completion_pill.reverse=true selector_focused.bold=true selector_focused.bg=#005f87 selector_focused.fg=white @@ -54,7 +53,9 @@ default.selected.bold=true default.selected.fg=white default.selected.bg=#005f87 +completion_pill.reverse=true completion_default.selected.bg=#005f87 +completion_description.dim=true [viewer] *.default=true diff --git a/stylesets/default b/stylesets/default index dd5f4a8d..22ea1701 100644 --- a/stylesets/default +++ b/stylesets/default @@ -48,9 +48,11 @@ #selector_focused.bg = 12 #selector_focused.fg = 15 +#completion_*.bg = 8 #completion_pill.bg = 12 -#completion_default.bg = 8 #completion_default.fg = 15 +#completion_description.fg = 15 +#completion_description.dim = true #[viewer] # Uncomment these two lines to reset all attributes in the [viewer] section. diff --git a/stylesets/monochrome b/stylesets/monochrome index 42d5352d..00b7f51b 100644 --- a/stylesets/monochrome +++ b/stylesets/monochrome @@ -30,6 +30,7 @@ part_filename.selected.bold = true selector_focused.reverse = true selector_chooser.bold = true +completion_description.dim = true [viewer] *.default = true diff --git a/stylesets/nord b/stylesets/nord index 3d1d76a3..d8388b94 100644 --- a/stylesets/nord +++ b/stylesets/nord @@ -18,6 +18,7 @@ statusline_default.reverse=true statusline_error.reverse=true completion_pill.reverse=true +completion_description.dim=true border.fg = #49576b diff --git a/stylesets/pink b/stylesets/pink index 87428874..65ef2fe2 100644 --- a/stylesets/pink +++ b/stylesets/pink @@ -43,7 +43,6 @@ part_*.selected.fg=#ffffff part_*.selected.bg=#de4e85 part_filename.selected.bold=true -completion_pill.reverse=true selector_focused.bold=true selector_focused.bg=#de4e85 selector_focused.fg=white @@ -54,7 +53,9 @@ default.selected.bold=true default.selected.fg=white default.selected.bg=#de4e85 +completion_pill.reverse=true completion_default.selected.bg=#de4e85 +completion_description.dim=true [viewer] *.default=true diff --git a/stylesets/solarized b/stylesets/solarized index 29717c72..9308d785 100644 --- a/stylesets/solarized +++ b/stylesets/solarized @@ -8,6 +8,7 @@ *error.bold=true border.reverse=true completion_pill.reverse=true +completion_description.dim=true error.fg=#dc322f # red header.bold=true selector_chooser.bold=true |