mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-19 22:54:17 +02:00
fix: resolve layout glitch when resizing the window
Ensures markdown content is rendered correctly after window resize. Previously, resizing could break layout due to improper initialization.
This commit is contained in:
parent
9240ab4625
commit
3cbfb8bd3e
2 changed files with 3 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ import (
|
|||
"github.com/charmbracelet/bubbles/spinner"
|
||||
"github.com/charmbracelet/bubbles/textinput"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/glow/v2/utils"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/charmbracelet/log"
|
||||
"github.com/muesli/reflow/ansi"
|
||||
|
|
@ -860,7 +861,7 @@ func loadLocalMarkdown(md *markdown) tea.Cmd {
|
|||
log.Debug("error reading local file", "error", err)
|
||||
return errMsg{err}
|
||||
}
|
||||
md.Body = string(data)
|
||||
md.Body = string(utils.RemoveFrontmatter(data))
|
||||
return fetchedMarkdownMsg(md)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
1
ui/ui.go
1
ui/ui.go
|
|
@ -175,6 +175,7 @@ func newModel(cfg Config, content string) tea.Model {
|
|||
m.state = stateShowDocument
|
||||
m.pager.currentDocument = markdown{
|
||||
localPath: path,
|
||||
Body: content,
|
||||
Note: stripAbsolutePath(path, cwd),
|
||||
Modtime: info.ModTime(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue