From 5515460f32e971a0e37fd134c139def0591d2c55 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 24 Aug 2020 17:00:27 -0400 Subject: [PATCH] Fix regression where note-setting on newly stashed items couldn't be done --- ui/stash.go | 4 ++-- ui/ui.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/stash.go b/ui/stash.go index 1062df9..9dba650 100644 --- a/ui/stash.go +++ b/ui/stash.go @@ -423,7 +423,7 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) { m.hideStatusMessage() md := m.selectedMarkdown() - isUserMarkdown := md.markdownType == stashedMarkdown + isUserMarkdown := md.markdownType == stashedMarkdown || md.markdownType == convertedMarkdown isSettingNote := m.state == stashStateSettingNote isPromptingDelete := m.state == stashStatePromptDelete @@ -441,7 +441,7 @@ func stashUpdate(msg tea.Msg, m stashModel) (stashModel, tea.Cmd) { break } - // if we're busy stashing this don't do it again + // If we're busy stashing this don't do it again _, exists := m.filesStashing[md.localPath] if exists || (md.markdownType != localMarkdown) || md.localPath == "" { diff --git a/ui/ui.go b/ui/ui.go index fbc6352..7af03bd 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -598,6 +598,7 @@ func localFileToMarkdown(cwd string, res gitcha.SearchResult) *markdown { return md } +// Lightweight version of reflow's indent function. func indent(s string, n int) string { if n <= 0 || s == "" { return s