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:
@@ -68,6 +68,7 @@ abstract class OmnisearchModal extends Modal {
|
||||
let openInNewPaneKey: Modifier[]
|
||||
let createInCurrentPaneKey: Modifier[]
|
||||
let createInNewPaneKey: Modifier[]
|
||||
let openInNewLeafKey: Modifier[] = ['Mod', 'Alt']
|
||||
if (settings.openInNewPane) {
|
||||
openInCurrentPaneKey = ['Mod']
|
||||
openInNewPaneKey = []
|
||||
@@ -86,6 +87,12 @@ abstract class OmnisearchModal extends Modal {
|
||||
eventBus.emit(Action.OpenInNewPane)
|
||||
})
|
||||
|
||||
// Open in a new leaf
|
||||
this.scope.register(openInNewLeafKey, 'Enter', e => {
|
||||
e.preventDefault()
|
||||
eventBus.emit(Action.OpenInNewLeaf)
|
||||
})
|
||||
|
||||
// Insert link
|
||||
this.scope.register(['Alt'], 'Enter', e => {
|
||||
e.preventDefault()
|
||||
|
||||
Reference in New Issue
Block a user