Skip to content

Commit 5b6004b

Browse files
committed
Merge remote-tracking branch 'gitlab/master'
2 parents 98a510a + 6e82f60 commit 5b6004b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/debug/warp10Debug.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ export class Warp10DebugSession extends LoggingDebugSession {
129129
this.inlineDecoration = window.createTextEditorDecorationType({ before: { color: "red", contentText: "⯆" } });
130130
window.activeTextEditor.setDecorations(this.inlineDecoration, [
131131
new Range(
132-
exception.info.line - 1,
133-
exception.info.colStart - 1,
134-
exception.info.line - 1,
135-
exception.info.colStart - 1
132+
Math.max(exception.info.line - 1, 0),
133+
Math.max(exception.info.colStart - 1, 0),
134+
Math.max(exception.info.line - 1, 0),
135+
Math.max(exception.info.colStart - 1, 0)
136136
)
137137
]);
138138
if (window.activeTextEditor) {
@@ -142,10 +142,10 @@ export class Warp10DebugSession extends LoggingDebugSession {
142142
code: '',
143143
message: exception.e,
144144
range: new Range(
145-
exception.info.line - 1,
146-
exception.info.colStart - 1,
147-
exception.info.line - 1,
148-
exception.info.colEnd
145+
Math.max(exception.info.line - 1, 0),
146+
Math.max(exception.info.colStart - 1, 0),
147+
Math.max(exception.info.line - 1, 0),
148+
Math.max(exception.info.colEnd, 0)
149149
),
150150
severity: DiagnosticSeverity.Error,
151151
source: window.activeTextEditor.document.uri.toString(),
@@ -166,10 +166,10 @@ export class Warp10DebugSession extends LoggingDebugSession {
166166
this.inlineDecoration = window.createTextEditorDecorationType({ before: { color: "red", contentText: "⯆" } });
167167
window.activeTextEditor.setDecorations(this.inlineDecoration, [
168168
new Range(
169-
info.line - 1,
170-
info.colStart - 1,
171-
info.line - 1,
172-
info.colStart - 1
169+
Math.max(info.line - 1, 0),
170+
Math.max(info.colStart - 1, 0),
171+
Math.max(info.line - 1, 0),
172+
Math.max(info.colStart - 1, 0)
173173
)
174174
]);
175175
}

0 commit comments

Comments
 (0)