Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elivsh: testing tag support #652

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion internal/shell/elvish/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type complexCandidate struct {
Description string
CodeSuffix string
Style string
Tag string
}

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

if len(values) > 0 {
Expand Down
4 changes: 2 additions & 2 deletions internal/shell/elvish/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ func Snippet(cmd *cobra.Command) string {
}
put $completion[Candidates] | all (one) | peach {|c|
if (eq $c[Description] "") {
edit:complex-candidate $c[Value] &display=(styled $c[Display] $c[Style]) &code-suffix=$c[CodeSuffix]
edit:complex-candidate $c[Value] &display=(styled $c[Display] $c[Style]) &code-suffix=$c[CodeSuffix] &tag=$c[Tag]
} else {
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]
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]
}
}
}
Expand Down
Loading