Skip to content

Commit 74055e8

Browse files
committed
diff: sort by value
1 parent 13c1a37 commit 74055e8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

diff.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package carapace
22

33
import (
44
"fmt"
5+
"sort"
56

67
"github.com/carapace-sh/carapace/internal/common"
78
"github.com/carapace-sh/carapace/pkg/style"
@@ -50,6 +51,7 @@ func Diff(original, new Action) Action {
5051
func DiffPatch(original, new Action, c Context) []string {
5152
diff := Diff(original, new).Invoke(c)
5253
patch := make([]string, 0)
54+
sort.Sort(common.ByValue(diff.action.rawValues))
5355
for _, v := range diff.action.rawValues {
5456
s := v.Value
5557
if v.Description != "" {

0 commit comments

Comments
 (0)