X Tutup
Skip to content

Fix error when deleting trailing lines removed breakpoints#112168

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
timothyqiu:breakpoint-lost
Oct 30, 2025
Merged

Fix error when deleting trailing lines removed breakpoints#112168
Repiteo merged 1 commit intogodotengine:masterfrom
timothyqiu:breakpoint-lost

Conversation

@timothyqiu
Copy link
Member

To reproduce the problem:

  1. Set a breakpoint on the last line.
  2. Delete the last line.

then you get an error like this:

ERROR: Index p_line = 12 is out of bounds (text.size() = 12).
at: get_line_gutter_metadata (scene/gui/text_edit.cpp:6876)

This error appears as long as a breakpoint is removed due to deleting lines and the breakpoint is outside the resulting script.

This is because the breakpoint_toggled signal is emitted for every breakpoint removed when text changes. Therefore, when handling this signal, we should consider cases where the breakpoint is located outside the existing lines.

@timothyqiu timothyqiu requested a review from a team as a code owner October 29, 2025 14:58
Copy link
Contributor

@kitbdev kitbdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, fixes the issue.

@Repiteo Repiteo merged commit 60f9409 into godotengine:master Oct 30, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 30, 2025

Thanks!

@timothyqiu timothyqiu deleted the breakpoint-lost branch October 31, 2025 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

X Tutup