From b7e7196f480703ac8925cff99b335196b94aec5e Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Thu, 17 Apr 2025 18:37:58 +0800 Subject: [PATCH] Shortcut to open link --- src/public/app/services/link.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/public/app/services/link.ts b/src/public/app/services/link.ts index f9d5912d4..a0d464741 100644 --- a/src/public/app/services/link.ts +++ b/src/public/app/services/link.ts @@ -278,15 +278,20 @@ function goToLinkExt(evt: MouseEvent | JQuery.ClickEvent | JQuery.MouseDownEvent const { notePath, viewScope } = parseNavigationStateFromUrl(hrefLink); const ctrlKey = utils.isCtrlKey(evt); + const shiftKey = evt.shiftKey; const isLeftClick = "which" in evt && evt.which === 1; const isMiddleClick = "which" in evt && evt.which === 2; const targetIsBlank = ($link?.attr("target") === "_blank"); const openInNewTab = (isLeftClick && ctrlKey) || isMiddleClick || targetIsBlank; + const activate = (isLeftClick && ctrlKey && shiftKey) || (isMiddleClick && shiftKey); + const openInNewWindow = isLeftClick && evt.shiftKey && !ctrlKey; if (notePath) { - if (openInNewTab) { + if (openInNewWindow) { + appContext.triggerCommand("openInWindow", { notePath, viewScope }); + } else if (openInNewTab) { appContext.tabManager.openTabWithNoteWithHoisting(notePath, { - activate: evt.shiftKey ? true : targetIsBlank, + activate: activate ? true : targetIsBlank, viewScope }); } else if (isLeftClick) {