Skip to content

Commit dc11e3d

Browse files
committed
initial commit adding search functionality
1 parent 4f358b4 commit dc11e3d

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

client/modules/IDE/components/Editor/stateUtils.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ import {
2020
syntaxHighlighting,
2121
defaultHighlightStyle
2222
} from '@codemirror/language';
23-
import { highlightSelectionMatches } from '@codemirror/search';
23+
import {
24+
highlightSelectionMatches,
25+
search,
26+
searchKeymap
27+
} from '@codemirror/search';
2428
import { closeBrackets, closeBracketsKeymap } from '@codemirror/autocomplete';
2529
import {
2630
defaultKeymap,
@@ -285,7 +289,8 @@ export function createNewFileState(filename, document, settings) {
285289
closeBracketsKeymap,
286290
defaultKeymap,
287291
historyKeymap,
288-
foldKeymap
292+
foldKeymap,
293+
searchKeymap
289294
];
290295

291296
// https://github.com/codemirror/basic-setup/blob/main/src/codemirror.ts
@@ -297,6 +302,7 @@ export function createNewFileState(filename, document, settings) {
297302

298303
// Everything below here should always be on.
299304
history(),
305+
search(),
300306
// Highlight extensions
301307
highlightActiveLine(),
302308
highlightActiveLineGutter(),

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,16 @@
5959
"^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)(|\\?byContent|\\?byUrl)$": "<rootDir>/client/__mocks__/fileMock.js",
6060
"\\.(css|less|scss)$": "<rootDir>/client/__mocks__/styleMock.js"
6161
},
62-
"transformIgnorePatterns": ["<rootDir>/node_modules/(?!colors-named|colors-named-hex|hsl-matcher|@emmetio/)"],
62+
"transformIgnorePatterns": [
63+
"<rootDir>/node_modules/(?!colors-named|colors-named-hex|hsl-matcher|@emmetio/)"
64+
],
6365
"transform": {
64-
"\\.[jt]sx?$": ["babel-jest", { "configFile": "./.babelrc" }]
66+
"\\.[jt]sx?$": [
67+
"babel-jest",
68+
{
69+
"configFile": "./.babelrc"
70+
}
71+
]
6572
},
6673
"testMatch": [
6774
"<rootDir>/client/**/*.test.(js|jsx)"
@@ -175,7 +182,7 @@
175182
"@codemirror/lang-xml": "^6.1.0",
176183
"@codemirror/language": "^6.11.0",
177184
"@codemirror/lint": "^6.8.5",
178-
"@codemirror/search": "^6.5.10",
185+
"@codemirror/search": "^6.5.11",
179186
"@codemirror/state": "^6.5.2",
180187
"@codemirror/view": "^6.36.5",
181188
"@emmetio/codemirror6-plugin": "^0.4.0",

0 commit comments

Comments
 (0)