This adds the shortcut `cmd/ctrl + alt + enter` to the search modal to open a found file in a new leaf. I used the term "split" in user-facing text, because I think that's the more common Some things to note: - This function ignores the existing "open in new pane by default" setting. - It also does not check to see if the file is already open. It will continue opening the value in a new split as often as the user wants.
This commit is contained in:
@@ -5,7 +5,8 @@ import { stringsToRegex } from './text-processing'
|
||||
export async function openNote(
|
||||
item: ResultNote,
|
||||
offset = 0,
|
||||
newPane = false
|
||||
newPane = false,
|
||||
newLeaf = false
|
||||
): Promise<void> {
|
||||
// Check if the note is already open,
|
||||
// to avoid opening it twice if the first one is pinned
|
||||
@@ -25,7 +26,7 @@ export async function openNote(
|
||||
|
||||
if (!alreadyOpenAndPinned) {
|
||||
// Open the note normally
|
||||
await app.workspace.openLinkText(item.path, '', newPane)
|
||||
await app.workspace.openLinkText(item.path, '', newLeaf ? 'split' : newPane)
|
||||
}
|
||||
|
||||
const view = app.workspace.getActiveViewOfType(MarkdownView)
|
||||
|
||||
Reference in New Issue
Block a user