removed duplication and unnecessary keymappings in codemirror config

This commit is contained in:
Dsm0
2025-07-16 15:17:34 -07:00
parent 06fafbd8eb
commit 5448fc6077
3 changed files with 10 additions and 11 deletions
+8 -8
View File
@@ -27,24 +27,24 @@ export const basicSetup = (() => [
// highlightActiveLineGutter(),
highlightSpecialChars(),
history(),
// foldGutter(),
drawSelection(),
// foldGutter(),
// drawSelection(),
dropCursor(),
// EditorState.allowMultipleSelections.of(true),
// indentOnInput(),
// syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
// syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
// autocompletion(),
rectangularSelection(),
crosshairCursor(),
// highlightActiveLine(),
highlightSelectionMatches(),
// highlightActiveLine(),
// highlightSelectionMatches(),
keymap.of([
...closeBracketsKeymap,
...defaultKeymap,
...searchKeymap,
// ...searchKeymap,
...historyKeymap,
...foldKeymap,
...completionKeymap,
// ...foldKeymap,
// ...completionKeymap,
]),
])();
+1 -2
View File
@@ -1,7 +1,7 @@
import { closeBrackets } from '@codemirror/autocomplete';
export { toggleComment, toggleBlockComment, toggleLineComment, toggleBlockCommentByLine } from '@codemirror/commands';
// import { search, highlightSelectionMatches } from '@codemirror/search';
import { history, indentWithTab } from '@codemirror/commands';
import { indentWithTab } from '@codemirror/commands';
import { javascript, javascriptLanguage } from '@codemirror/lang-javascript';
import { defaultHighlightStyle, syntaxHighlighting, bracketMatching } from '@codemirror/language';
import { Compartment, EditorState, Prec } from '@codemirror/state';
@@ -97,7 +97,6 @@ export function initEditor({ initialCode = '', onChange, onEvaluate, onStop, roo
// indentOnInput(), // works without. already brought with javascript extension?
// bracketMatching(), // does not do anything
syntaxHighlighting(defaultHighlightStyle),
history(),
EditorView.updateListener.of((v) => onChange(v)),
drawSelection({ cursorBlinkRate: 0 }),
Prec.highest(
+1 -1
View File
@@ -28,5 +28,5 @@ const keymaps = {
export function keybindings(name) {
const active = keymaps[name];
return [active ? active() : []];
return [active ? Prec.high(active()) : []];
}