summaryrefslogtreecommitdiff
path: root/menu
diff options
context:
space:
mode:
authorewy <ewy0@protonmail.com>2026-04-22 19:27:25 +0200
committerewy <ewy0@protonmail.com>2026-04-22 19:29:16 +0200
commit5e1e840bbcdf8348ae62145e1b7231764fcc5a97 (patch)
treedad5d223dc95b643febde31c45beb2d68110aa9c /menu
parentf13b2bcf9a3a5ea6afeaa60c7a2e801e8e79a2c1 (diff)
update script experiment
Diffstat (limited to 'menu')
-rw-r--r--menu/banner.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/menu/banner.go b/menu/banner.go
index b65cbbf..33d79d4 100644
--- a/menu/banner.go
+++ b/menu/banner.go
@@ -43,6 +43,9 @@ var (
BannerDryStyle = style.New(func() lipgloss.Style {
return lipgloss.NewStyle().Foreground(BannerDryColor).Bold(true).MarginRight(1)
})
+ BannerDefaultStyle = style.New(func() lipgloss.Style {
+ return lipgloss.NewStyle().Faint(true).MarginLeft(1)
+ })
)
func Banner(source *model.Source, target model.Target, args ...string) string {
@@ -53,7 +56,15 @@ func Banner(source *model.Source, target model.Target, args ...string) string {
parts = append(parts, BannerPromptStyle.Render("> "))
parts = append(parts, BannerSelfStyle.Render("pik"))
parts = append(parts, BannerSourceLabelStyle.Render(source.Label()))
+ def := false
if sub := target.Sub(); sub != nil {
+
+ // remove "default" invocations
+ if sub[len(sub)-1] == target.ShortestId() {
+ sub = sub[:len(sub)-1]
+ def = true
+ }
+
for i, s := range sub {
sub[i] = BannerSubItemStyle.Render(s)
}
@@ -75,6 +86,9 @@ func Banner(source *model.Source, target model.Target, args ...string) string {
parts = append(parts, BannerArgsStyle.Render(argParts...))
}
+ if def {
+ parts = append(parts, BannerDefaultStyle.Render("# "+target.Label()))
+ }
result := BannerStyle.Render(lipgloss.JoinHorizontal(lipgloss.Left, parts...))
return result
}