Skip to content

Commit 78225f0

Browse files
committed
elvish: tag support
1 parent 36543e4 commit 78225f0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

internal/shell/elvish/action.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ type complexCandidate struct {
3636
Description string
3737
CodeSuffix string
3838
Style string
39+
Tag string
3940
}
4041

4142
// ActionRawValues formats values for elvish.
@@ -60,7 +61,7 @@ func ActionRawValues(currentWord string, meta common.Meta, values common.RawValu
6061
if val.Style == "" || ui.ParseStyling(val.Style) == nil {
6162
val.Style = valueStyle
6263
}
63-
vals[index] = complexCandidate{Value: val.Value, Display: val.Display, Description: val.Description, CodeSuffix: suffix, Style: val.Style}
64+
vals[index] = complexCandidate{Value: val.Value, Display: val.Display, Description: val.Description, CodeSuffix: suffix, Style: val.Style, Tag: val.Tag}
6465
}
6566

6667
if len(values) > 0 {

internal/shell/elvish/snippet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ func Snippet(cmd *cobra.Command) string {
2020
}
2121
put $completion[Candidates] | all (one) | peach {|c|
2222
if (eq $c[Description] "") {
23-
edit:complex-candidate $c[Value] &display=(styled $c[Display] $c[Style]) &code-suffix=$c[CodeSuffix]
23+
edit:complex-candidate $c[Value] &display=(styled $c[Display] $c[Style]) &code-suffix=$c[CodeSuffix] &tag=$c[Tag]
2424
} else {
25-
edit:complex-candidate $c[Value] &display=(styled $c[Display] $c[Style])(styled " " $completion[DescriptionStyle]" bg-default")(styled "("$c[Description]")" $completion[DescriptionStyle]) &code-suffix=$c[CodeSuffix]
25+
edit:complex-candidate $c[Value] &display=(styled $c[Display] $c[Style])(styled " " $completion[DescriptionStyle]" bg-default")(styled "("$c[Description]")" $completion[DescriptionStyle]) &code-suffix=$c[CodeSuffix] &tag=$c[Tag]
2626
}
2727
}
2828
}

0 commit comments

Comments
 (0)