X Tutup
Skip to content

Add column boundary check in the autocompletion.#110017

Merged
akien-mga merged 1 commit intogodotengine:masterfrom
bruvzg:acomp_col_check
Oct 6, 2025
Merged

Add column boundary check in the autocompletion.#110017
akien-mga merged 1 commit intogodotengine:masterfrom
bruvzg:acomp_col_check

Conversation

@bruvzg
Copy link
Member

@bruvzg bruvzg commented Aug 27, 2025

Fixes #110009 Fixes #110393

@bruvzg bruvzg added this to the 4.5 milestone Aug 27, 2025
@bruvzg bruvzg requested a review from a team as a code owner August 27, 2025 10:14
@bruvzg bruvzg added bug topic:editor crash cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release labels Aug 27, 2025
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.

Fixes the crash

/* Auto brace completion */
int CodeEdit::_get_auto_brace_pair_open_at_pos(int p_line, int p_col) {
const String &line = get_line(p_line);
int caret_col = MIN(p_col, line.length());
Copy link
Contributor

Choose a reason for hiding this comment

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

The changes in this function also shouldn't be necessary.

@Repiteo Repiteo added the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label Sep 4, 2025
@Repiteo Repiteo modified the milestones: 4.5, 4.6 Sep 4, 2025
@kitbdev
Copy link
Contributor

kitbdev commented Sep 11, 2025

@Mostafa808
Copy link

I tested this PR. It really fixes the crash.
But it introduces some unexpected behavior when p_replace is passed with an argument of false (when pressing Shift+Tab or Shift+Enter) while in selection mode like that:
selection_column_confirmation_1
selection_column_confirmation_2

I am not sure what is the use case of p_replace parameter but setting it to false confuses which column should the cursor be.

@kitbdev
Copy link
Contributor

kitbdev commented Sep 15, 2025

But it introduces some unexpected behavior when p_replace is passed with an argument of false (when pressing Shift+Tab or Shift+Enter) while in selection mode like that:

The autocomplete shouldn't really be used when there is a selection, so I think that issue can be fixed later by closing it automatically when a selection starts.

Copy link
Contributor

@Repiteo Repiteo 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. Just needs ATS suggestion added

@akien-mga akien-mga merged commit 480f3d1 into godotengine:master Oct 6, 2025
20 checks passed
@akien-mga
Copy link
Member

Cherry-picked for 4.5.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release crash topic:editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Godot crashes on script editor autocomplete Editor crashes when selecting a long method from autocompletion

6 participants

X Tutup