From 32dd4c3d0868aad2be69fc054ec65eb58a9d82bf Mon Sep 17 00:00:00 2001 From: Benjamin Nussbaum Date: Mon, 5 Jan 2026 14:43:30 +0100 Subject: [PATCH] fix: codemirror enable searchKeymap, selectAll --- resources/js/codemirror-core.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/resources/js/codemirror-core.js b/resources/js/codemirror-core.js index c77bf3d..f23389f 100644 --- a/resources/js/codemirror-core.js +++ b/resources/js/codemirror-core.js @@ -1,8 +1,9 @@ import { EditorView, lineNumbers, keymap } from '@codemirror/view'; import { ViewPlugin } from '@codemirror/view'; -import { indentWithTab } from '@codemirror/commands'; +import { indentWithTab, selectAll } from '@codemirror/commands'; import { foldGutter, foldKeymap } from '@codemirror/language'; import { history, historyKeymap } from '@codemirror/commands'; +import { searchKeymap } from '@codemirror/search'; import { html } from '@codemirror/lang-html'; import { javascript } from '@codemirror/lang-javascript'; import { json } from '@codemirror/lang-json'; @@ -154,7 +155,16 @@ export function createCodeMirror(element, options = {}) { createResizePlugin(), ...(Array.isArray(languageSupport) ? languageSupport : [languageSupport]), ...themeSupport, - keymap.of([indentWithTab, ...foldKeymap, ...historyKeymap]), + keymap.of([ + indentWithTab, + ...foldKeymap, + ...historyKeymap, + ...searchKeymap, + { + key: 'Mod-a', + run: selectAll, + }, + ]), EditorView.theme({ '&': { fontSize: '14px',