feat: add keyboard shortcut to save file in text

editor
This commit is contained in:
Aviral Sharma 2025-03-23 14:05:23 +05:30
parent 58990b41ae
commit 6caef65a4a

View file

@ -52,6 +52,7 @@ import type {
} from "./types";
import type App from "../components/App";
import type { AppState } from "../types";
import { actionSaveFileToDisk } from "../actions";
const getTransform = (
width: number,
@ -392,6 +393,9 @@ export const textWysiwyg = ({
event.preventDefault();
submittedViaKeyboard = true;
handleSubmit();
} else if (event.key === KEYS.S && event[KEYS.CTRL_OR_CMD]) {
event.preventDefault();
app.actionManager.executeAction(actionSaveFileToDisk, "ui");
} else if (event.key === KEYS.ENTER && event[KEYS.CTRL_OR_CMD]) {
event.preventDefault();
if (event.isComposing || event.keyCode === 229) {