Skip to content

Commit 2a6e591

Browse files
dsjkvf097115
authored andcommitted
review: bindings display restrained
1 parent 0f063f2 commit 2a6e591

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"
@@ -1709,11 +1710,22 @@ func newReviewMessage(composer *Composer, err error) *reviewMessage {
17091710
name := command[1]
17101711
strokes, _ := config.ParseKeyStrokes(cmd)
17111712
var inputs []string
1712-
for _, input := range bindings.GetReverseBindings(strokes) {
1713-
inputs = append(inputs, config.FormatKeyStrokes(input))
1713+
// force bindings for specific commands
1714+
switch cmd[:5] {
1715+
case ":send":
1716+
inputs = append(inputs, "y")
1717+
case ":abor":
1718+
inputs = append(inputs, "n")
1719+
default:
1720+
for _, input := range bindings.GetReverseBindings(strokes) {
1721+
inputs = append(inputs, config.FormatKeyStrokes(input))
1722+
}
1723+
}
1724+
// skip non-bound commands
1725+
if len(strings.Join(inputs[:], ", ")) > 0 {
1726+
actions = append(actions, fmt.Sprintf(" %-6s %-40s %s",
1727+
strings.Join(inputs[:], ", "), name, cmd))
17141728
}
1715-
actions = append(actions, fmt.Sprintf(" %-6s %-40s %s",
1716-
strings.Join(inputs, ", "), name, cmd))
17171729
}
17181730

17191731
spec := []ui.GridSpec{

0 commit comments

Comments
 (0)