diff options
author | Bence Ferdinandy <bence@ferdinandy.com> | 2023-09-19 08:51:50 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-09-19 11:09:16 +0200 |
commit | 4400b08a95b4f4548388e34858516df33d80b2d3 (patch) | |
tree | 6b52c8acd8d5fda566d22efa326886468c7e7c8f /main.go | |
parent | 194d263bbe2bd685b192ddcebbc64c099e3a8dc1 (diff) | |
download | aerc-4400b08a95b4f4548388e34858516df33d80b2d3.tar.gz |
commands: strip leading colons from commands
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.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -71,7 +71,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 { if set.ByName(name) != nil { |