~rjarry/aerc-devel

aerc: commands: strip leading colons from commands v1 APPLIED

Bence Ferdinandy: 1
 commands: strip leading colons from commands

 1 files changed, 1 insertions(+), 2 deletions(-)
#1059698 alpine-edge.yml failed
#1059699 openbsd.yml failed
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rjarry/aerc-devel/patches/44858/mbox | git am -3
Learn more about email & git

[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.
---
 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: