Skip to content

Commit 5b9b0a2

Browse files
committed
review: bindings display restrained
1 parent 03ae4a5 commit 5b9b0a2

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

app/compose.go

+16-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"net/textproto"
1010
"os"
1111
"os/exec"
12+
"strconv"
1213
"strings"
1314
"sync"
1415
"sync/atomic"
@@ -1699,11 +1700,22 @@ func newReviewMessage(composer *Composer, err error) *reviewMessage {
16991700
name := command[1]
17001701
strokes, _ := config.ParseKeyStrokes(cmd)
17011702
var inputs []string
1702-
for _, input := range bindings.GetReverseBindings(strokes) {
1703-
inputs = append(inputs, config.FormatKeyStrokes(input))
1703+
// force bindings for specific commands
1704+
switch cmd[:5] {
1705+
case ":send":
1706+
inputs = append(inputs, "y")
1707+
case ":abor":
1708+
inputs = append(inputs, "n")
1709+
default:
1710+
for _, input := range bindings.GetReverseBindings(strokes) {
1711+
inputs = append(inputs, config.FormatKeyStrokes(input))
1712+
}
1713+
}
1714+
// skip non-bound commands
1715+
if len(strings.Join(inputs[:], ", ")) > 0 {
1716+
actions = append(actions, fmt.Sprintf(" %-6s %-40s %s",
1717+
strings.Join(inputs[:], ", "), name, cmd))
17041718
}
1705-
actions = append(actions, fmt.Sprintf(" %-6s %-40s %s",
1706-
strings.Join(inputs, ", "), name, cmd))
17071719
}
17081720

17091721
spec := []ui.GridSpec{

0 commit comments

Comments
 (0)