Add a prefix according to the markdownType when filtering notes

This commit is contained in:
Nicolas Martin 2020-10-25 04:50:18 +01:00 committed by Christian Rocha
parent faeef13e55
commit fbe93a90ff

View file

@ -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)