[PATCH aerc] commands: strip leading colons from commands
Export this patch
When giving advice on commands to run the colon is often included to
signify that the snippet is needs to be run as an aerc command.
Unfortunately, copying this into the command prompt of aerc leads to an
error. Copy the behaviour of vim and strip any number of leading colons
from command names.
Acked-by: Robin-Jarry <robin@jarry.cc>
Applied after rebasing on latest master and adding a missing
Signed-off-by trailer. Thanks!
---
main.go | 3 + --
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/main.go b/main.go
index e0c4f89..4ae8831 100644
--- a/main.go
+++ b/main.go
@@ -72,8 +72,7 @@ func expandAbbreviations(cmd []string, sets []*commands.Commands) []string {
if len(cmd) == 0 {
return cmd
}
-
- name := cmd[0]
+ name := strings.TrimLeft(cmd[0], ":")
candidate := ""
for _, set := range sets {
// do we have a direct match?
--
2.42.0
aerc/patches: FAILED in 1m19s
[commands: strip leading colons from commands][0] from [Bence Ferdinandy][1]
[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/44858
[1]: mailto:bence@ferdinandy.com
✗ #1059699 FAILED aerc/patches/openbsd.yml https://builds.sr.ht/~rjarry/job/1059699
✗ #1059698 FAILED aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1059698
Bence Ferdinandy, Sep 19, 2023 at 08:52: