mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 06:04:18 +00:00
Move status message next to the logo in the file browser
This commit is contained in:
parent
28ccb85b2e
commit
47b24f66d0
1 changed files with 11 additions and 6 deletions
17
ui/stash.go
17
ui/stash.go
|
@ -16,6 +16,7 @@ import (
|
|||
"github.com/charmbracelet/charm"
|
||||
lib "github.com/charmbracelet/charm/ui/common"
|
||||
"github.com/muesli/reflow/ansi"
|
||||
"github.com/muesli/reflow/truncate"
|
||||
te "github.com/muesli/termenv"
|
||||
"github.com/sahilm/fuzzy"
|
||||
)
|
||||
|
@ -1032,14 +1033,18 @@ func (m stashModel) view() string {
|
|||
}
|
||||
|
||||
// Rules for the logo, filter and status message.
|
||||
var logoOrFilter string
|
||||
if m.showStatusMessage {
|
||||
logoOrFilter = m.statusMessage.String()
|
||||
logoOrFilter := " "
|
||||
if m.showStatusMessage && m.isFiltering() {
|
||||
logoOrFilter += m.statusMessage.String()
|
||||
} else if m.isFiltering() {
|
||||
logoOrFilter = m.filterInput.View()
|
||||
logoOrFilter += m.filterInput.View()
|
||||
} else {
|
||||
logoOrFilter = glowLogoView(" Glow ")
|
||||
logoOrFilter += glowLogoView(" Glow ")
|
||||
if m.showStatusMessage {
|
||||
logoOrFilter += " " + m.statusMessage.String()
|
||||
}
|
||||
}
|
||||
logoOrFilter = truncate.StringWithTail(logoOrFilter, uint(m.common.width), ellipsis)
|
||||
|
||||
help, helpHeight := m.helpView()
|
||||
|
||||
|
@ -1072,7 +1077,7 @@ func (m stashModel) view() string {
|
|||
}
|
||||
|
||||
s += fmt.Sprintf(
|
||||
"%s %s\n\n %s\n\n%s\n\n%s %s\n\n%s",
|
||||
"%s%s\n\n %s\n\n%s\n\n%s %s\n\n%s",
|
||||
loadingIndicator,
|
||||
logoOrFilter,
|
||||
header,
|
||||
|
|
Loading…
Reference in a new issue