This commit is contained in:
Simon Cambier
2022-07-16 20:06:57 +02:00
parent 817c972233
commit 7ccb531d88
2 changed files with 4 additions and 5 deletions

View File

@@ -106,13 +106,13 @@ async function scrollIntoView(): Promise<void> {
elem?.scrollIntoView({ behavior: "auto", block: "nearest" })
}
async function openSelection(): Promise<void> {
async function openSelection(evt: MouseEvent): Promise<void> {
// TODO: clean me, merge with notes.openNote()
if (note) {
modal.close()
if (parent) parent.close()
await app.workspace.openLinkText(note.path, "")
await app.workspace.openLinkText(note.path, "", evt.ctrlKey)
const view = app.workspace.getActiveViewOfType(MarkdownView)
if (!view) {
throw new Error("OmniSearch - No active MarkdownView")

View File

@@ -51,12 +51,11 @@ async function updateResults() {
lastSearch = searchQuery
selectedIndex = 0
scrollIntoView()
// if (resultNotes.length) console.log(resultNotes[0])
}
function onClick() {
function onClick(evt: MouseEvent) {
if (!selectedNote) return
openNote(selectedNote)
openNote(selectedNote, evt.ctrlKey) // Keep ctrl pressed to open in a new pane
modal.close()
}