Renamed some functions, fixed some throws

This commit is contained in:
Simon Cambier
2022-10-19 22:03:05 +02:00
parent ec71beca5a
commit 576ad7c3ff
7 changed files with 36 additions and 30 deletions

View File

@@ -122,7 +122,9 @@
// Move cursor to the match
const view = app.workspace.getActiveViewOfType(MarkdownView)
if (!view) {
throw new Error('OmniSearch - No active MarkdownView')
// Not an editable document, so no cursor to place
return
// throw new Error('OmniSearch - No active MarkdownView')
}
const offset = groupedOffsets[selectedIndex] ?? 0

View File

@@ -12,7 +12,7 @@
$: reg = stringsToRegex(note.foundWords)
$: matches = Search.getMatches(note.content, reg)
$: cleanedContent = makeExcerpt(note.content, note.matches[0]?.offset ?? -1)
$: glyph = cacheManager.getNoteFromCache(note.path)?.doesNotExist
$: glyph = cacheManager.getNoteFromMemCache(note.path)?.doesNotExist
$: title = settings.showShortName ? note.basename : note.path
</script>