Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit b7e7196

Browse files
committed
Shortcut to open link
1 parent 49bc6e8 commit b7e7196

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/public/app/services/link.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,20 @@ function goToLinkExt(evt: MouseEvent | JQuery.ClickEvent | JQuery.MouseDownEvent
278278
const { notePath, viewScope } = parseNavigationStateFromUrl(hrefLink);
279279

280280
const ctrlKey = utils.isCtrlKey(evt);
281+
const shiftKey = evt.shiftKey;
281282
const isLeftClick = "which" in evt && evt.which === 1;
282283
const isMiddleClick = "which" in evt && evt.which === 2;
283284
const targetIsBlank = ($link?.attr("target") === "_blank");
284285
const openInNewTab = (isLeftClick && ctrlKey) || isMiddleClick || targetIsBlank;
286+
const activate = (isLeftClick && ctrlKey && shiftKey) || (isMiddleClick && shiftKey);
287+
const openInNewWindow = isLeftClick && evt.shiftKey && !ctrlKey;
285288

286289
if (notePath) {
287-
if (openInNewTab) {
290+
if (openInNewWindow) {
291+
appContext.triggerCommand("openInWindow", { notePath, viewScope });
292+
} else if (openInNewTab) {
288293
appContext.tabManager.openTabWithNoteWithHoisting(notePath, {
289-
activate: evt.shiftKey ? true : targetIsBlank,
294+
activate: activate ? true : targetIsBlank,
290295
viewScope
291296
});
292297
} else if (isLeftClick) {

0 commit comments

Comments
 (0)