mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-21 07:34:18 +02:00
Merge 820dbd1a2e into e5cb757278
This commit is contained in:
commit
754e131f6c
1 changed files with 1 additions and 7 deletions
8
ui/ui.go
8
ui/ui.go
|
|
@ -190,13 +190,7 @@ func (m model) Init() tea.Cmd {
|
|||
case stateShowStash:
|
||||
cmds = append(cmds, findLocalFiles(*m.common))
|
||||
case stateShowDocument:
|
||||
content, err := os.ReadFile(m.common.cfg.Path)
|
||||
if err != nil {
|
||||
log.Error("unable to read file", "file", m.common.cfg.Path, "error", err)
|
||||
return func() tea.Msg { return errMsg{err} }
|
||||
}
|
||||
body := string(utils.RemoveFrontmatter(content))
|
||||
cmds = append(cmds, renderWithGlamour(m.pager, body))
|
||||
cmds = append(cmds, loadLocalMarkdown(&m.pager.currentDocument))
|
||||
}
|
||||
|
||||
return tea.Batch(cmds...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue