mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-18 22:36:10 +01:00
🎨 https://github.com/siyuan-note/siyuan/issues/11205 & https://github.com/siyuan-note/siyuan/pull/15824
This commit is contained in:
parent
d9e0c56a47
commit
ec6e7a019e
9 changed files with 63 additions and 58 deletions
|
|
@ -40,6 +40,7 @@ import {openCard} from "../../../card/openCard";
|
|||
import {syncGuide} from "../../../sync/syncGuide";
|
||||
import {Wnd} from "../../../layout/Wnd";
|
||||
import {unsplitWnd} from "../../../menus/tab";
|
||||
import {openFileById} from "../../../editor/util";
|
||||
|
||||
export const globalCommand = (command: string, app: App) => {
|
||||
/// #if MOBILE
|
||||
|
|
@ -148,6 +149,15 @@ export const globalCommand = (command: string, app: App) => {
|
|||
case "recentDocs":
|
||||
openRecentDocs();
|
||||
return true;
|
||||
case "recentClosed":
|
||||
if (window.siyuan.closedTabs.length > 0) {
|
||||
openFileById({
|
||||
app,
|
||||
id: window.siyuan.closedTabs.pop(),
|
||||
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL]
|
||||
});
|
||||
}
|
||||
return true;
|
||||
case "toggleDock":
|
||||
toggleDockBar(document.querySelector("#barDock use"));
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ export const commandPanel = (app: App) => {
|
|||
"goToTab5", "goToTab6", "goToTab7", "goToTab8", "goToTab9", "goToTabNext", "goToTabPrev", "lockScreen",
|
||||
"mainMenu", "move", "newFile", "recentDocs", "replace", "riffCard", "search", "selectOpen1", "syncNow",
|
||||
"splitLR", "splitMoveB", "splitMoveR", "splitTB", "tabToWindow", "stickSearch", "toggleDock", "unsplitAll",
|
||||
"unsplit"];
|
||||
"unsplit", "recentClosed"];
|
||||
/// #if !BROWSER
|
||||
keys.push("toggleWin");
|
||||
/// #endif
|
||||
|
|
|
|||
|
|
@ -1532,15 +1532,10 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
|
|||
return;
|
||||
}
|
||||
|
||||
if (matchHotKey("⇧⌘T", event)) {
|
||||
if ((window as any).siyuan.closedTabs && (window as any).siyuan.closedTabs.length > 0) {
|
||||
const closedTab = (window as any).siyuan.closedTabs.pop();
|
||||
openFileById({
|
||||
app,
|
||||
id: closedTab.id,
|
||||
action: [Constants.CB_GET_FOCUS, Constants.CB_GET_SCROLL]
|
||||
});
|
||||
}
|
||||
if (matchHotKey(window.siyuan.config.keymap.general.recentClosed.custom, event)) {
|
||||
execByCommand({
|
||||
command: "closeTab"
|
||||
});
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue