refactor:

- dedupe flash / highlighting logic
- codemirror logic now lives only in codemirror package
- remove old highlighting logic
- use codemirror package in react package
- cleanup CodeMirror6.jsx
- pull setMiniLocations into useHighlighting
- migrate MiniRepl, nano-repl + Repl to new highlighting
This commit is contained in:
Felix Roos 2023-07-04 21:49:39 +02:00
parent 7f12ce9b45
commit 34176ab5f8
13 changed files with 215 additions and 426 deletions

View file

@ -71,6 +71,7 @@ export function MiniRepl({
evalOnMount,
drawContext,
drawTime,
afterEval: ({ meta }) => setMiniLocations(meta.miniLocations),
});
const [view, setView] = useState();
@ -84,7 +85,7 @@ export function MiniRepl({
}
return isVisible || wasVisible.current;
}, [isVisible, hideOutsideView]);
useHighlighting({
const { setMiniLocations } = useHighlighting({
view,
pattern,
active: started && !activeCode?.includes('strudel disable-highlighting'),