Skip to content

Commit b62b15c

Browse files
committed
editor: fixed issue #230
1 parent f50aa23 commit b62b15c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/ide/views/editors.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { cobalt } from "../../themes/cobalt";
2121
import { disassemblyTheme } from "../../themes/disassemblyTheme";
2222
import { editorTheme } from "../../themes/editorTheme";
2323
import { mbo } from "../../themes/mbo";
24-
import { clearBreakpoint, current_project, lastDebugState, platform, qs, runToPC } from "../ui";
24+
import { clearBreakpoint, current_project, lastDebugState, platform, projectWindows, qs, runToPC } from "../ui";
2525
import { isMobileDevice, ProjectView } from "./baseviews";
2626
import { debugHighlightTagsTooltip } from "./debug";
2727
import { createTextTransformFilterEffect, textTransformFilterCompartment } from "./filters";
@@ -448,6 +448,10 @@ export class SourceEditor implements ProjectView {
448448

449449
this.clearCurrentLine(moveCursor);
450450
if (line) {
451+
// Validate line number is within document range (TODO: open disassembler)
452+
if (line.line < 1 || line.line > this.editor.state.doc.lines) {
453+
return false;
454+
}
451455
addCurrentMarker(line);
452456
if (moveCursor) {
453457
const targetLine = this.editor.state.doc.line(line.line);
@@ -458,6 +462,7 @@ export class SourceEditor implements ProjectView {
458462
});
459463
}
460464
this.currentDebugLine = line;
465+
return true;
461466
}
462467
}
463468

0 commit comments

Comments
 (0)