mirror of
https://github.com/charmbracelet/glow.git
synced 2026-08-09 09:49:09 +02:00
fix: handle case when selected md is nil
This commit is contained in:
parent
5b2dfddcda
commit
ee27edd3b1
1 changed files with 6 additions and 0 deletions
|
|
@ -518,6 +518,12 @@ func (m *stashModel) handleDocumentBrowsing(msg tea.Msg) tea.Cmd {
|
||||||
// Edit document in EDITOR
|
// Edit document in EDITOR
|
||||||
case "e":
|
case "e":
|
||||||
md := m.selectedMarkdown()
|
md := m.selectedMarkdown()
|
||||||
|
|
||||||
|
// In case no file is available
|
||||||
|
if md == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
return openEditor(md.localPath, 0)
|
return openEditor(md.localPath, 0)
|
||||||
|
|
||||||
// Open document
|
// Open document
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue