From b6530991cca283b1eb25c0e9da3204be7f6e6310 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 3 May 2023 17:50:06 +0200 Subject: [PATCH] fix adding breakpoint --- libs/remix-ui/editor/src/lib/remix-ui-editor.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx index 8461478de9..ee614eddaa 100644 --- a/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx +++ b/libs/remix-ui/editor/src/lib/remix-ui-editor.tsx @@ -556,7 +556,10 @@ export const EditorUI = (props: EditorUIProps) => { reducerListener(props.plugin, dispatch, monacoRef.current, editorRef.current, props.events) props.events.onEditorMounted() editor.onMouseUp((e) => { - if (e && e.target && e.target.toString().startsWith('GUTTER')) { + // see https://microsoft.github.io/monaco-editor/typedoc/enums/editor.MouseTargetType.html + // 2 is GUTTER_GLYPH_MARGIN + // 3 is GUTTER_LINE_NUMBERS + if (e && e.target && (e.target.type === 2 || e.target.type === 3)) { (window as any).addRemixBreakpoint(e.target.position) } })