Revamp key bindings

This is a work in progress revamp of the key binding system. It implements a system, built on top of CodeMirror's key binding system, for defining key bindings. 

The system uses a dumb "KeyShortcut" -> "Command" mapping with a set of default keys (which will be different if Heynote's Emacs mode is used) that can be overridden by user key bindings.

The key bindings are *displayed* in the Settings, and it's possible to set user defined key bindings in Heynote's config file, but it's not yet possible to define custom key bindings in the UI.

Previously we Heynote on a bunch of default key bindings from CodeMirror (some of which was not "block aware"). This is no longer the case, and because of this, it's quite likely that there are key bindings that was previously working that is now missing (if so, these can easily be added later).
This commit is contained in:
Jonatan Heyman
2025-04-10 20:04:44 +02:00
parent 9be328cbe4
commit 94f5534611
15 changed files with 615 additions and 225 deletions

View File

@ -13,6 +13,7 @@ test.beforeEach(async ({ page, browserName }) => {
test.skip()
}
await page.locator("css=.status-block.settings").click()
await page.locator("css=li.tab-keyboard-bindings").click()
//await page.locator("css=li.tab-editing").click()
await page.locator("css=select.keymap").selectOption("emacs")
if (heynotePage.isMac) {