minirepl: highlighting can now be disabled

This commit is contained in:
Felix Roos
2022-06-05 22:44:24 +02:00
parent 349c1bc5d8
commit 352d701b7b
3 changed files with 6 additions and 6 deletions
+2 -2
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -548,7 +548,7 @@ function Icon({ type }) {
}
function MiniRepl({ tune, defaultSynth, hideOutsideView = false, theme, init }) {
const { code, setCode, pattern, activateCode, evaluateOnly, error, cycle, dirty, togglePlay } = useRepl({
const { code, setCode, pattern, activeCode, activateCode, evaluateOnly, error, cycle, dirty, togglePlay } = useRepl({
tune,
defaultSynth,
autolink: false
@@ -567,7 +567,7 @@ function MiniRepl({ tune, defaultSynth, hideOutsideView = false, theme, init })
}
return isVisible || wasVisible.current;
}, [isVisible, hideOutsideView]);
useHighlighting({ view, pattern, active: cycle.started });
useHighlighting({ view, pattern, active: cycle.started && !activeCode?.includes("strudel disable-highlighting") });
return /* @__PURE__ */ React.createElement("div", {
className: styles.container,
ref
+2 -2
View File
@@ -10,7 +10,7 @@ import styles from './MiniRepl.module.css';
import { Icon } from './Icon';
export function MiniRepl({ tune, defaultSynth, hideOutsideView = false, theme, init }) {
const { code, setCode, pattern, activateCode, evaluateOnly, error, cycle, dirty, togglePlay } = useRepl({
const { code, setCode, pattern, activeCode, activateCode, evaluateOnly, error, cycle, dirty, togglePlay } = useRepl({
tune,
defaultSynth,
autolink: false,
@@ -29,7 +29,7 @@ export function MiniRepl({ tune, defaultSynth, hideOutsideView = false, theme, i
}
return isVisible || wasVisible.current;
}, [isVisible, hideOutsideView]);
useHighlighting({ view, pattern, active: cycle.started });
useHighlighting({ view, pattern, active: cycle.started && !activeCode?.includes('strudel disable-highlighting') });
return (
<div className={styles.container} ref={ref}>
<div className={styles.header}>