Skip to content

Commit 6e34919

Browse files
author
Emil Andersson
committed
fix issue with incorrect multi-statement warning when repeatedly clicking setting on and off
1 parent 968eb15 commit 6e34919

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/browser/modules/Editor/Monaco.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,13 @@ const Monaco = ({
145145

146146
const model = editorRef.current?.getModel() as editor.ITextModel
147147

148+
// clearing markers again solves issue with incorrect multi-statement warning when user spam clicks setting on and off
149+
editor.setModelMarkers(
150+
editorRef.current?.getModel() as editor.ITextModel,
151+
monacoId,
152+
[]
153+
)
154+
148155
// add multi statement warning if multi setting is off
149156
if (statements.length > 1 && !enableMultiStatementMode) {
150157
const secondStatementLine = statements[1].start.line

0 commit comments

Comments
 (0)