diff --git a/src/ui/React/ANSIITypography.tsx b/src/ui/React/ANSIITypography.tsx index 347101c72..18a931467 100644 --- a/src/ui/React/ANSIITypography.tsx +++ b/src/ui/React/ANSIITypography.tsx @@ -97,7 +97,7 @@ export const ANSIITypography = React.memo((props: IProps): React.ReactElement => parts.push({ code: null, text: text }); } return ( - + {parts.map((part, i) => ( {part.text} diff --git a/src/ui/React/LogBoxManager.tsx b/src/ui/React/LogBoxManager.tsx index 2378fc2f3..24f579d7d 100644 --- a/src/ui/React/LogBoxManager.tsx +++ b/src/ui/React/LogBoxManager.tsx @@ -139,6 +139,7 @@ function LogWindow(props: IProps): React.ReactElement { const [script, setScript] = useState(props.script); const classes = useStyles(); const container = useRef(null); + const textArea = useRef(null); const setRerender = useState(false)[1]; const [size, setSize] = useState<[number, number]>([500, 500]); const [minimized, setMinimized] = useState(false); @@ -146,6 +147,19 @@ function LogWindow(props: IProps): React.ReactElement { setRerender((old) => !old); } + const textAreaKeyDown = (e: React.KeyboardEvent) => { + if (e.ctrlKey && e.key === "a") { + if (!textArea.current) return; //Should never happen + const r = new Range(); + r.setStartBefore(textArea.current); + r.setEndAfter(textArea.current); + document.getSelection()?.removeAllRanges(); + document.getSelection()?.addRange(r); + e.preventDefault(); + e.stopPropagation(); + } + }; + const onResize = (e: React.SyntheticEvent, { size }: ResizeCallbackData) => { setSize([size.width, size.height]); }; @@ -364,15 +378,18 @@ function LogWindow(props: IProps): React.ReactElement { - +
{script.logs.map( (line: string, i: number): JSX.Element => ( ), )} - +