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:
parent
7f12ce9b45
commit
34176ab5f8
13 changed files with 215 additions and 426 deletions
|
|
@ -126,13 +126,6 @@ export function Repl({ embedded = false }) {
|
|||
isLineWrappingEnabled,
|
||||
} = useSettings();
|
||||
|
||||
const [miniLocations, setMiniLocations] = useState([]);
|
||||
useEffect(() => {
|
||||
if (view) {
|
||||
updateMiniLocations(view, miniLocations);
|
||||
}
|
||||
}, [view, miniLocations]);
|
||||
|
||||
const { code, setCode, scheduler, evaluate, activateCode, isDirty, activeCode, pattern, started, stop, error } =
|
||||
useStrudel({
|
||||
initialCode: '// LOADING...',
|
||||
|
|
@ -195,7 +188,7 @@ export function Repl({ embedded = false }) {
|
|||
);
|
||||
|
||||
// highlighting
|
||||
useHighlighting({
|
||||
const { setMiniLocations } = useHighlighting({
|
||||
view,
|
||||
pattern,
|
||||
active: started && !activeCode?.includes('strudel disable-highlighting'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue