Use Ctrl + Shift + Click on the launcher pane to open and activate in a new tab.

This commit is contained in:
SiriusXT
2025-05-04 17:18:02 +08:00
parent d3a6079d9b
commit 9765f2f6d7
3 changed files with 18 additions and 3 deletions

View File

@@ -28,15 +28,21 @@ export default class OpenNoteButtonWidget extends OnClickButtonWidget {
if (evt.which === 3) {
return;
}
const hoistedNoteId = this.getHoistedNoteId();
const ctrlKey = utils.isCtrlKey(evt);
if ((evt.which === 1 && ctrlKey) || evt.which === 2) {
await appContext.tabManager.openInNewTab(this.noteToOpen.noteId);
const activate = evt.shiftKey ? true : false;
await appContext.tabManager.openInNewTab(this.noteToOpen.noteId, hoistedNoteId, activate);
} else {
await appContext.tabManager.openInSameTab(this.noteToOpen.noteId);
}
}
getHoistedNoteId() {
return this.noteToOpen.getRelationValue("hoistedNote") || appContext.tabManager.getActiveContext()?.hoistedNoteId;
}
initialRenderCompleteEvent() {
// we trigger refresh above
}