mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 14:14:17 +00:00
Shorten status messages to 2 seconds
This commit is contained in:
parent
d6f296c44b
commit
e01dc95d7d
3 changed files with 6 additions and 3 deletions
|
@ -269,7 +269,7 @@ func pagerUpdate(msg tea.Msg, m pagerModel) (pagerModel, tea.Cmd) {
|
|||
if m.statusMessageTimer != nil {
|
||||
m.statusMessageTimer.Stop()
|
||||
}
|
||||
m.statusMessageTimer = time.NewTimer(time.Second * 3)
|
||||
m.statusMessageTimer = time.NewTimer(statusMessageTimeout)
|
||||
cmds = append(cmds, waitForStatusMessageTimeout(pagerContext, m.statusMessageTimer))
|
||||
|
||||
case stashErrMsg:
|
||||
|
|
|
@ -311,7 +311,7 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
|
|||
if m.statusMessageTimer != nil {
|
||||
m.statusMessageTimer.Stop()
|
||||
}
|
||||
m.statusMessageTimer = time.NewTimer(time.Second * 3)
|
||||
m.statusMessageTimer = time.NewTimer(statusMessageTimeout)
|
||||
cmds = append(cmds, waitForStatusMessageTimeout(stashContext, m.statusMessageTimer))
|
||||
|
||||
case statusMessageTimeoutMsg:
|
||||
|
|
5
ui/ui.go
5
ui/ui.go
|
@ -17,7 +17,10 @@ import (
|
|||
te "github.com/muesli/termenv"
|
||||
)
|
||||
|
||||
const noteCharacterLimit = 256 // should match server
|
||||
const (
|
||||
noteCharacterLimit = 256 // should match server
|
||||
statusMessageTimeout = time.Second * 2 // how long to show status messages like "stashed!"
|
||||
)
|
||||
|
||||
var (
|
||||
config Config
|
||||
|
|
Loading…
Reference in a new issue