mirror of
https://github.com/charmbracelet/glow
synced 2025-03-04 23:07:12 +00:00
Add a prefix according to the markdownType when filtering notes
This commit is contained in:
parent
faeef13e55
commit
fbe93a90ff
1 changed files with 9 additions and 1 deletions
10
ui/stash.go
10
ui/stash.go
|
@ -229,7 +229,15 @@ func (m *stashModel) getNotes() []*markdown {
|
||||||
targets := []string{}
|
targets := []string{}
|
||||||
|
|
||||||
for _, t := range m.markdowns {
|
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)
|
ranks := fuzzy.RankFindFold(m.searchInput.Value(), targets)
|
||||||
|
|
Loading…
Add table
Reference in a new issue