repair command line

This commit is contained in:
Alexander Bentkamp
2023-03-15 16:55:50 +01:00
parent 07ec94b7c2
commit f2eed5fc0c
4 changed files with 56 additions and 24 deletions
@@ -170,21 +170,6 @@ export function CommandLine() {
return () => { l.dispose() }
}, [oneLineEditor, runCommand])
// Effect when command line mode gets enabled
useEffect(() => {
if (commandLineMode) {
const endPos = editor.getModel().getFullModelRange().getEndPosition()
if (editor.getModel().getLineContent(endPos.lineNumber).trim() !== "") {
editor.executeEdits("command-line", [{
range: monaco.Selection.fromPositions(endPos, endPos),
text: commandLineInput + "\n",
forceMoveMarkers: false
}]);
}
editor.setPosition(editor.getModel().getFullModelRange().getEndPosition())
}
}, [commandLineMode])
const handleSubmit : React.FormEventHandler<HTMLFormElement> = (ev) => {
ev.preventDefault()
runCommand()
+1 -1
View File
@@ -18,7 +18,7 @@ import { EditorContext, ConfigContext, ProgressContext, VersionContext } from '.
import { WithRpcSessions } from '../../../../node_modules/lean4-infoview/src/infoview/rpcSessions';
import { ServerVersion } from '../../../../node_modules/lean4-infoview/src/infoview/serverVersion';
import { useAppDispatch, useAppSelector } from '../../hooks';
import { codeEdited, levelCompleted, selectCompleted } from '../../state/progress';
import { levelCompleted, selectCompleted } from '../../state/progress';
export function Main(props: {world: string, level: number}) {