diff options
Diffstat (limited to 'ui/pager.go')
-rw-r--r-- | ui/pager.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/pager.go b/ui/pager.go index dea001b..b3c56e8 100644 --- a/ui/pager.go +++ b/ui/pager.go @@ -283,6 +283,12 @@ func (m pagerModel) update(msg tea.Msg) (pagerModel, tea.Cmd) { } return m, textinput.Blink + + case "e": + if m.currentDocument.docType == LocalDoc { + return m, openEditor(m.currentDocument.localPath) + } + case "s": if m.common.authStatus != authOK { break @@ -341,6 +347,12 @@ func (m pagerModel) update(msg tea.Msg) (pagerModel, tea.Cmd) { cmds = append(cmds, viewport.Sync(m.viewport)) } + // We've finished editing the document, potentially making changes. Let's + // retrieve the latest version of the document so that we display + // up-to-date contents. + case editorFinishedMsg: + return m, loadLocalMarkdown(&m.currentDocument) + // We've reveived terminal dimensions, either for the first time or // after a resize case tea.WindowSizeMsg: |