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

Fix wrong selection on cloning a line down in the editor #36621

Conversation

WizardOhio24
Copy link
Contributor

Fixes #36282, the selection was wrong because the column being selected for the end of the selection was using some weird formula (it looks like the one used in finding the line the selection should be moved to).

@akien-mga akien-mga added this to the 4.0 milestone Feb 28, 2020
@akien-mga akien-mga added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Feb 28, 2020
@groud
Copy link
Member

groud commented Feb 28, 2020

Note, this was made in #24574 to close #21814. We have to make sure this does not bring back any problem.

@akien-mga
Copy link
Member

CC @rxlecky

I think it was probably a copy paste mistake, we can see further up in https://github.com/godotengine/godot/pull/24574/files#diff-86e49621fcb98c850c78e73214c8b478R1081 that the same logic as in this PR is used.

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.

Close fix, however the feature allows you to duplicate your selection on the same line. With this the selection is completely removed.

Taking a guess, it probably only needs to do the current calculation if the to and from lines match.

@WizardOhio24 WizardOhio24 force-pushed the fix-wrong-selection-on-line-clone-down branch from 748ed4c to 28f7432 Compare February 29, 2020 16:33
@WizardOhio24
Copy link
Contributor Author

Ah Ok, I understand why the formula was there. As you suggested, I've changed it so it only does the calculation if the to and from lines match, it works for a duplication on a single line now.

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.

Thanks for the contribution, LGTM!

@akien-mga akien-mga merged commit 55396d6 into godotengine:master Mar 1, 2020
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.2.1.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Mar 4, 2020
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.

When multiple lines are duplicated, the selection is wrong
5 participants