Skip to content

Commit 5fb4f5c

Browse files
committed
fix bug i just caused in goto line (from find)
1 parent e373da0 commit 5fb4f5c

File tree

1 file changed

+5
-2
lines changed
  • src/packages/frontend/frame-editors/code-editor

1 file changed

+5
-2
lines changed

src/packages/frontend/frame-editors/code-editor/actions.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,9 @@ export class Actions<
18331833
// TODO: this is VERY CRAPPY CODE -- wait after,
18341834
// so cm gets state/value fully set.
18351835
await delay(100);
1836-
if (this._state == "closed") return;
1836+
if (this._state == "closed") {
1837+
return;
1838+
}
18371839
doc.setCursor(pos);
18381840
cm.scrollIntoView(pos, cm.getScrollInfo().clientHeight / 2);
18391841
}
@@ -3074,7 +3076,8 @@ export class Actions<
30743076
}
30753077

30763078
if (fragmentId.line) {
3077-
this.programmatical_goto_line?.(fragmentId.line);
3079+
if (this._state == "closed") return;
3080+
this.programmatical_goto_line?.(fragmentId.line, true);
30783081
}
30793082

30803083
if (fragmentId.chat && !this.path.endsWith(".sage-chat")) {

0 commit comments

Comments
 (0)