mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-21 15:44:17 +02:00
Load the whole stash, page by page, automatically
This commit is contained in:
parent
5023d4a0be
commit
c16a146c00
2 changed files with 6 additions and 4 deletions
|
|
@ -383,9 +383,14 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) {
|
|||
m.loadingFromNetwork = false
|
||||
docs = wrapMarkdowns(stashedMarkdown, msg)
|
||||
|
||||
// If the server comes back with nothing then we've got everything
|
||||
if len(msg) == 0 {
|
||||
// If the server comes back with nothing then we've got
|
||||
// everything
|
||||
m.stashFullyLoaded = true
|
||||
} else {
|
||||
// Load the next page
|
||||
m.page++
|
||||
cmds = append(cmds, loadStash(m))
|
||||
}
|
||||
|
||||
case gotNewsMsg:
|
||||
|
|
|
|||
3
ui/ui.go
3
ui/ui.go
|
|
@ -315,9 +315,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||
m.stash.setSize(msg.Width, msg.Height)
|
||||
m.pager.setSize(msg.Width, msg.Height)
|
||||
|
||||
// TODO: load more stash pages if we've resized, are on the last page,
|
||||
// and haven't loaded more pages yet.
|
||||
|
||||
case initLocalFileSearchMsg:
|
||||
m.localFileFinder = msg.ch
|
||||
m.general.cwd = msg.cwd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue