Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 33 additions & 9 deletions src/cm/commandRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,17 +503,31 @@ function registerCoreCommands() {
return true;
},
});
addCommand({
name: "increaseUiZoom",
description: "Increase UI zoom",
readOnly: true,
requiresView: false,
run: () => adjustUiZoom(10),
});
addCommand({
name: "decreaseUiZoom",
description: "Decrease UI zoom",
readOnly: true,
requiresView: false,
run: () => adjustUiZoom(-10),
});
addCommand({
name: "increaseFontSize",
description: "Increase font size",
readOnly: false,
description: "Increase editor font size",
readOnly: true,
requiresView: false,
run: () => adjustFontSize(1),
});
addCommand({
name: "decreaseFontSize",
description: "Decrease font size",
readOnly: false,
description: "Decrease editor font size",
readOnly: true,
requiresView: false,
run: () => adjustFontSize(-1),
});
Expand Down Expand Up @@ -1307,12 +1321,20 @@ async function openInAppBrowserCommand() {
function adjustFontSize(delta) {
const current = settings?.value?.fontSize || "12px";
const numeric = Number.parseInt(current, 10) || 12;
const next = Math.max(1, numeric + delta);
const next = Math.min(72, Math.max(6, numeric + delta));
settings.value.fontSize = `${next}px`;
settings.update(false);
return true;
}

function adjustUiZoom(delta) {
const current = Number(settings?.value?.uiZoom) || 100;
const next = Math.min(160, Math.max(70, current + delta));
settings.value.uiZoom = next;
settings.update(false);
return true;
}

function parseKeyString(keyString) {
if (!keyString) return [];
return String(keyString)
Expand Down Expand Up @@ -1356,10 +1378,12 @@ function buildResolvedKeyBindingsSnapshot() {

function toCodeMirrorKey(combo) {
if (!combo) return null;
const parts = combo
.split("-")
.map((part) => part.trim())
.filter(Boolean);
const parts = combo.endsWith("-")
? [...combo.slice(0, -1).split("-").filter(Boolean), "-"]
: combo
.split("-")
.map((part) => part.trim())
.filter(Boolean);
const modifiers = [];
let key = null;

Expand Down
58 changes: 27 additions & 31 deletions src/components/terminal/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { WebLinksAddon } from "@xterm/addon-web-links";
import { WebglAddon } from "@xterm/addon-webgl";
import { Terminal as Xterm } from "@xterm/xterm";
import {
executeCommand,
getResolvedKeyBindings,
getResolvedKeyBindingsVersion,
} from "cm/commandRegistry";
Expand Down Expand Up @@ -347,7 +348,7 @@ export default class TerminalComponent {

const parsedBindings = [];

Object.values(getResolvedKeyBindings()).forEach((binding) => {
Object.entries(getResolvedKeyBindings()).forEach(([name, binding]) => {
if (!binding.key) return;

// Skip editor-only keybindings in terminal
Expand All @@ -357,8 +358,11 @@ export default class TerminalComponent {
const keys = binding.key.split("|");

keys.forEach((keyCombo) => {
const parts = keyCombo.split("-");
const parts = keyCombo.endsWith("-")
? [...keyCombo.slice(0, -1).split("-").filter(Boolean), "-"]
: keyCombo.split("-");
const parsed = {
name,
ctrl: false,
shift: false,
alt: false,
Expand Down Expand Up @@ -414,62 +418,54 @@ export default class TerminalComponent {
return false;
}

// Check for Ctrl+= or Ctrl++ (increase font size)
if (event.ctrlKey && (event.key === "+" || event.key === "=")) {
// Keep terminal font zoom local. Shift variants are handled by app keybindings below.
if (
event.ctrlKey &&
!event.shiftKey &&
!event.altKey &&
!event.metaKey &&
(event.key === "+" || event.key === "=")
) {
event.preventDefault();
this.increaseFontSize();
return false;
}

// Check for Ctrl+- (decrease font size)
if (event.ctrlKey && event.key === "-") {
if (
event.ctrlKey &&
!event.shiftKey &&
!event.altKey &&
!event.metaKey &&
event.key === "-"
) {
event.preventDefault();
this.decreaseFontSize();
return false;
}

// Only intercept specific app-wide keybindings, let terminal handle the rest
if (event.ctrlKey || event.altKey || event.metaKey) {
// Skip modifier-only keys
if (["Control", "Alt", "Meta", "Shift"].includes(event.key)) {
return true;
}

// Get parsed app keybindings
const appKeybindings = this.parseAppKeybindings();

// Check if this is an app-specific keybinding
const isAppKeybinding = appKeybindings.some(
const eventKey = event.key === "_" ? "-" : event.key.toLowerCase();
const binding = appKeybindings.find(
(binding) =>
binding.ctrl === event.ctrlKey &&
binding.shift === event.shiftKey &&
binding.alt === event.altKey &&
binding.meta === event.metaKey &&
binding.key === event.key.toLowerCase(),
binding.key === eventKey,
);

if (isAppKeybinding) {
const appEvent = new KeyboardEvent("keydown", {
key: event.key,
ctrlKey: event.ctrlKey,
shiftKey: event.shiftKey,
altKey: event.altKey,
metaKey: event.metaKey,
bubbles: true,
cancelable: true,
});

// Dispatch to document so it gets picked up by the app's keyboard handler
document.dispatchEvent(appEvent);

// Return false to prevent terminal from processing this key
if (binding && executeCommand(binding.name)) {
return false;
}

// For all other modifier combinations, let the terminal handle them
return true;
}

if (event.ctrlKey || event.altKey || event.metaKey) return true;

// Return true to allow normal processing for other keys
return true;
});
Expand Down
4 changes: 3 additions & 1 deletion src/lang/ar-ye.json
Original file line number Diff line number Diff line change
Expand Up @@ -723,5 +723,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/be-by.json
Original file line number Diff line number Diff line change
Expand Up @@ -725,5 +725,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/bn-bd.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/cs-cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/de-de.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
2 changes: 2 additions & 0 deletions src/lang/en-us.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"tab size": "Tab size",
"text wrap": "Text wrap / Word wrap",
"theme": "Theme",
"ui zoom": "UI zoom",
"unable to delete file": "unable to delete file",
"unable to open file": "Sorry, unable to open file",
"unable to open folder": "Sorry, unable to open folder",
Expand Down Expand Up @@ -650,6 +651,7 @@
"settings-info-app-side-buttons": "Show extra action buttons beside the editor.",
"settings-info-app-sponsor-sidebar": "Show the sponsor entry in the sidebar.",
"settings-info-app-touch-move-threshold": "Minimum movement before a touch drag is detected.",
"settings-info-app-ui-zoom": "Scale text across the Acode interface.",
"settings-info-app-vibrate-on-tap": "Enable haptic feedback for taps and controls.",
"settings-info-editor-autosave": "Save changes automatically after a delay.",
"settings-info-editor-color-preview": "Preview color values inline in the editor.",
Expand Down
4 changes: 3 additions & 1 deletion src/lang/es-sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/fr-fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/he-il.json
Original file line number Diff line number Diff line change
Expand Up @@ -725,5 +725,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/hi-in.json
Original file line number Diff line number Diff line change
Expand Up @@ -725,5 +725,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/hu-hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Balra lévő lapok bezárása",
"close other tabs": "Többi lap bezárása",
"auto close tags": "Címkék automatikus lezárása",
"settings-info-editor-auto-close-tags": "HTML, XML, Vue, Angular és PHP-sablonfájlokban a záró címkék automatikus beillesztése."
"settings-info-editor-auto-close-tags": "HTML, XML, Vue, Angular és PHP-sablonfájlokban a záró címkék automatikus beillesztése.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/id-id.json
Original file line number Diff line number Diff line change
Expand Up @@ -725,5 +725,7 @@
"close tabs to left": "Tutup Kiri",
"close other tabs": "Tutup Lainnya",
"auto close tags": "Penutup tag otomatis",
"settings-info-editor-auto-close-tags": "Menyisipkan tag penutup di berkas HTML, XML, Vue, Angular, dan templat PHP secara otomatis."
"settings-info-editor-auto-close-tags": "Menyisipkan tag penutup di berkas HTML, XML, Vue, Angular, dan templat PHP secara otomatis.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/ir-fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -725,5 +725,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/it-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/ja-jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/ko-kr.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/ml-in.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/mm-unicode.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/mm-zawgyi.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/pl-pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
4 changes: 3 additions & 1 deletion src/lang/pu-in.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,5 +724,7 @@
"close tabs to left": "Close Left",
"close other tabs": "Close Others",
"auto close tags": "Auto close tags",
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files."
"settings-info-editor-auto-close-tags": "Automatically insert closing tags in HTML, XML, Vue, Angular, and PHP template files.",
"ui zoom": "UI zoom",
"settings-info-app-ui-zoom": "Scale text across the Acode interface."
}
Loading