Fixed #61
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user