fix(editor): exit shortcut capture state when restoring defaults

This commit is contained in:
Abeautifulsnow authored and GitHub committed 2026-09-15 15:59:50 +08:00
1 parent 2b1c5fa71e
commit 2ee04c51ec
3 files changed
+259

No files matched your search

@@ -1666,6 +1666,11 @@ async function restartDbxForDuckDbIsolation() {
}
function resetDefaultsForTab(tab: SettingsCategory) {
// Restoring defaults exits any in-progress shortcut capture so the affected
// rows return to their initial (non-editing) state instead of staying stuck
// in edit mode (#9066). Cleared unconditionally because the edit state can
// leak across tab switches (shortcuts/formatter tabs share the table).
editingShortcutId.value = null;
if (tab === "editor") {
editFontFamily.value = DEFAULT_EDITOR_SETTINGS.fontFamily;
editFontSize.value = DEFAULT_EDITOR_SETTINGS.fontSize;
@@ -1794,6 +1799,9 @@ function resetDefaultsForTab(tab: SettingsCategory) {
}
function resetAllDefaults() {
// Same contract as resetDefaultsForTab: a full reset also exits any
// in-progress shortcut capture (#9066).
editingShortcutId.value = null;
editFontFamily.value = DEFAULT_EDITOR_SETTINGS.fontFamily;
editFontSize.value = DEFAULT_EDITOR_SETTINGS.fontSize;
editTableFontFamily.value = DEFAULT_EDITOR_SETTINGS.tableFontFamily;