Add setting to open/create files in new pane by default (#241)

* Manifest 1.14.1-beta.1

* 1.14.1-beta.2 manifest

* Add setting to open/create files in new pane by default

* Fix typo with key labels

* Address review comments

---------

Co-authored-by: Simon Cambier <simon.cambier@protonmail.com>
This commit is contained in:
Ian Fisher
2023-05-19 03:53:31 -04:00
committed by GitHub
parent b5c1d31e85
commit 027c9e3bc9
5 changed files with 59 additions and 10 deletions

View File

@@ -39,9 +39,24 @@
let indexingStepDesc = ''
let searching = true
let refInput: InputSearch | undefined
let openInNewPaneKey: string
let openInCurrentPaneKey: string
let createInNewPaneKey: string
let createInCurrentPaneKey: string
$: selectedNote = resultNotes[selectedIndex]
$: searchQuery = searchQuery ?? previousQuery
$: if (settings.openInNewPane) {
openInNewPaneKey = '↵'
openInCurrentPaneKey = getCtrlKeyLabel() + ' ↵'
createInNewPaneKey = 'shift ↵'
createInCurrentPaneKey = 'ctrl shift ↵'
} else {
openInNewPaneKey = getCtrlKeyLabel() + ' ↵'
openInCurrentPaneKey = '↵'
createInNewPaneKey = 'ctrl shift ↵'
createInCurrentPaneKey = 'shift ↵'
}
$: if (searchQuery) {
searching = true
updateResults().then(() => {
@@ -309,7 +324,7 @@
<span>to cycle history</span>
</div>
<div class="prompt-instruction">
<span class="prompt-instruction-command"></span><span>to open</span>
<span class="prompt-instruction-command">{openInCurrentPaneKey}</span><span>to open</span>
</div>
<div class="prompt-instruction">
<span class="prompt-instruction-command">tab</span>
@@ -317,15 +332,15 @@
</div>
<div class="prompt-instruction">
<span class="prompt-instruction-command">{getCtrlKeyLabel()}</span>
<span class="prompt-instruction-command">{openInNewPaneKey}</span>
<span>to open in a new pane</span>
</div>
<div class="prompt-instruction">
<span class="prompt-instruction-command">shift ↵</span>
<span class="prompt-instruction-command">{createInCurrentPaneKey}</span>
<span>to create</span>
</div>
<div class="prompt-instruction">
<span class="prompt-instruction-command">ctrl shift ↵</span>
<span class="prompt-instruction-command">{createInNewPaneKey}</span>
<span>to create in a new pane</span>
</div>