From fbe93a90ff77c6fd1be5af39257614fd3c8a27c2 Mon Sep 17 00:00:00 2001 From: Nicolas Martin Date: Sun, 25 Oct 2020 04:50:18 +0100 Subject: [PATCH] Add a prefix according to the markdownType when filtering notes --- ui/stash.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/stash.go b/ui/stash.go index b344f39..3b5330b 100644 --- a/ui/stash.go +++ b/ui/stash.go @@ -229,7 +229,15 @@ func (m *stashModel) getNotes() []*markdown { targets := []string{} for _, t := range m.markdowns { - targets = append(targets, t.Note) + prefix := "" + switch t.markdownType { + case newsMarkdown: + prefix = "News: " + case convertedMarkdown: + prefix = t.localPath + } + + targets = append(targets, prefix+t.Note) } ranks := fuzzy.RankFindFold(m.searchInput.Value(), targets)