MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / resetKeyBindings

Function resetKeyBindings

src/cm/commandRegistry.js:1601–1615  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1599}
1600
1601export async function resetKeyBindings() {
1602 try {
1603 const fs = fsOperation(KEYBINDING_FILE);
1604 const fileName = Url.basename(KEYBINDING_FILE);
1605 const content = JSON.stringify(keyBindings, undefined, 2);
1606 if (!(await fs.exists())) {
1607 await fsOperation(DATA_STORAGE).createFile(fileName, content);
1608 return;
1609 }
1610 await fs.writeFile(content);
1611 } catch (error) {
1612 window.log?.("error", "Reset Keybinding failed!");
1613 window.log?.("error", error);
1614 }
1615}
1616
1617export { commandKeymapCompartment };
1618

Callers 2

callbackFunction · 0.90
loadCustomKeyBindingsFunction · 0.85

Calls 6

fsOperationFunction · 0.85
basenameMethod · 0.80
logMethod · 0.80
existsMethod · 0.65
createFileMethod · 0.65
writeFileMethod · 0.45

Tested by

no test coverage detected