Fixed #61
This commit is contained in:
@@ -106,13 +106,13 @@ async function scrollIntoView(): Promise<void> {
|
|||||||
elem?.scrollIntoView({ behavior: "auto", block: "nearest" })
|
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()
|
// TODO: clean me, merge with notes.openNote()
|
||||||
if (note) {
|
if (note) {
|
||||||
modal.close()
|
modal.close()
|
||||||
if (parent) parent.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)
|
const view = app.workspace.getActiveViewOfType(MarkdownView)
|
||||||
if (!view) {
|
if (!view) {
|
||||||
throw new Error("OmniSearch - No active MarkdownView")
|
throw new Error("OmniSearch - No active MarkdownView")
|
||||||
|
|||||||
@@ -51,12 +51,11 @@ async function updateResults() {
|
|||||||
lastSearch = searchQuery
|
lastSearch = searchQuery
|
||||||
selectedIndex = 0
|
selectedIndex = 0
|
||||||
scrollIntoView()
|
scrollIntoView()
|
||||||
// if (resultNotes.length) console.log(resultNotes[0])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClick() {
|
function onClick(evt: MouseEvent) {
|
||||||
if (!selectedNote) return
|
if (!selectedNote) return
|
||||||
openNote(selectedNote)
|
openNote(selectedNote, evt.ctrlKey) // Keep ctrl pressed to open in a new pane
|
||||||
modal.close()
|
modal.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user