File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,18 @@ func Snippet(cmd *cobra.Command) string {
1919 edit:notify (styled "usage: " $completion[DescriptionStyle])$completion[Usage]
2020 }
2121 put $completion[Candidates] | all (one) | peach {|c|
22- if (eq $c[Description] "") {
23- edit:complex-candidate $c[Value] &display=(styled $c[Display] $c[Style]) &code-suffix=$c[CodeSuffix] &tag=$c[Tag]
24- } 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] &tag=$c[Tag]
22+ try {
23+ if (eq $c[Description] "") {
24+ edit:complex-candidate $c[Value] &display=(styled $c[Display] $c[Style]) &code-suffix=$c[CodeSuffix] &tag=$c[Tag]
25+ } else {
26+ 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]
27+ }
28+ } catch {
29+ if (eq $c[Description] "") {
30+ edit:complex-candidate $c[Value] &display=(styled $c[Display] $c[Style]) &code-suffix=$c[CodeSuffix]
31+ } else {
32+ 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]
33+ }
2634 }
2735 }
2836 }
You can’t perform that action at this time.
0 commit comments