diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 6aff1af9..fa89d88f 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -24,6 +24,7 @@ "@sentry/react": "^7.99.0", "@swc/helpers": "^0.5.3", "@tanstack/react-query": "^5.17.15", + "@uiw/codemirror-extensions-basic-setup": "^4.23.2", "@uiw/codemirror-theme-xcode": "^4.21.21", "@uiw/codemirror-themes": "^4.21.21", "@uiw/react-markdown-preview": "^5.0.7", @@ -3062,6 +3063,32 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@uiw/codemirror-extensions-basic-setup": { + "version": "4.23.2", + "resolved": "https://registry.npmjs.org/@uiw/codemirror-extensions-basic-setup/-/codemirror-extensions-basic-setup-4.23.2.tgz", + "integrity": "sha512-eacivkj7wzskl2HBYs4rfN0CbYlsSQh5ADtOYWTpc8Txm4ONw8RTi4/rxF6Ks2vdaovizewU5QaHximbxoNTrw==", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@codemirror/autocomplete": ">=6.0.0", + "@codemirror/commands": ">=6.0.0", + "@codemirror/language": ">=6.0.0", + "@codemirror/lint": ">=6.0.0", + "@codemirror/search": ">=6.0.0", + "@codemirror/state": ">=6.0.0", + "@codemirror/view": ">=6.0.0" + } + }, "node_modules/@uiw/codemirror-theme-xcode": { "version": "4.23.0", "resolved": "https://registry.npmjs.org/@uiw/codemirror-theme-xcode/-/codemirror-theme-xcode-4.23.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index 2943c1e7..84630660 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -37,6 +37,7 @@ "@sentry/react": "^7.99.0", "@swc/helpers": "^0.5.3", "@tanstack/react-query": "^5.17.15", + "@uiw/codemirror-extensions-basic-setup": "^4.23.2", "@uiw/codemirror-theme-xcode": "^4.21.21", "@uiw/codemirror-themes": "^4.21.21", "@uiw/react-markdown-preview": "^5.0.7", diff --git a/frontend/src/components/editor/Editor.tsx b/frontend/src/components/editor/Editor.tsx index 1c6dfe29..64843a66 100644 --- a/frontend/src/components/editor/Editor.tsx +++ b/frontend/src/components/editor/Editor.tsx @@ -2,8 +2,9 @@ import { markdown } from "@codemirror/lang-markdown"; import { EditorState } from "@codemirror/state"; import { keymap } from "@codemirror/view"; import { Vim, vim } from "@replit/codemirror-vim"; +import { basicSetup } from "@uiw/codemirror-extensions-basic-setup"; import { xcodeDark, xcodeLight } from "@uiw/codemirror-theme-xcode"; -import { basicSetup, EditorView } from "codemirror"; +import { EditorView } from "codemirror"; import { useCallback, useEffect, useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { ScrollSyncPane } from "react-scroll-sync"; @@ -73,7 +74,7 @@ function Editor(props: EditorProps) { doc: editorStore.doc.getRoot().content?.toString() ?? "", extensions: [ keymap.of(setKeymapConfig()), - basicSetup, + basicSetup({ highlightSelectionMatches: false }), markdown(), configStore.codeKey === CodeKeyType.VIM ? vim() : [], themeMode == "light" ? xcodeLight : xcodeDark,