Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TextEdit selection when inserting line #31496

Merged

Conversation

pouleyKetchoupp
Copy link
Contributor

Selection columns could be invalid after inserting a line in TextEdit (e.g adding warning ignore hints). Now the line indices will be updated when needed, in order to grow or move the selection depending on the case.

Fixes #31458

@Chaosus Chaosus added this to the 3.2 milestone Aug 20, 2019
@akien-mga akien-mga requested a review from Paulb23 August 20, 2019 10:53
Copy link
Member

@Paulb23 Paulb23 left a comment

Choose a reason for hiding this comment

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

Rather then adjusting the selection, it should deselect the text as this method moves the caret to the line. Which could be miles away.

@pouleyKetchoupp
Copy link
Contributor Author

It makes sense to make it consistent. But what about just not moving the caret either? I don't really see the purpose of changing anything in the current selection or cursor while disabling a warning.

@Paulb23
Copy link
Member

Paulb23 commented Aug 22, 2019

Yeah that works too, looks like it's only used for disabling warnings and it's not exposed to scripting, so no compatibility breakage.

@pouleyKetchoupp
Copy link
Contributor Author

Cool, I'll do it this way then.

@pouleyKetchoupp pouleyKetchoupp force-pushed the fix-text-edit-insert-selection branch from 5fa16cc to bc839ed Compare August 25, 2019 13:44
@pouleyKetchoupp
Copy link
Contributor Author

@Paulb23 Changes are done. Now the cursor is adjusted the same way as the selection.

Copy link
Member

@Paulb23 Paulb23 left a comment

Choose a reason for hiding this comment

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

LGTM.

@akien-mga akien-mga merged commit 0985d5f into godotengine:master Aug 25, 2019
@akien-mga
Copy link
Member

Thanks!

@pouleyKetchoupp pouleyKetchoupp deleted the fix-text-edit-insert-selection branch August 26, 2019 07:52
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.

Index p_to_column=31 out of size when ignoring errors
4 participants