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 TextEdit visible line count when setting text #102296

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kitbdev
Copy link
Contributor

@kitbdev kitbdev commented Feb 1, 2025

remove_range actually removes from p_from_line + 1 to p_to_line, it seems weird, but it is to preserve gutters on the first line I think. The line content will be replaced afterwards anyway.

The total_visible_line_count should now be in sync with the actual text that is removed, so the future call to invalidate_text will calculate the change correctly.

The for loop should function the same but be more clear.
remove_range is only called from _base_remove_text which handles validation of the arguments so it isn't needed here. The max and min functions never do anything.

@kitbdev kitbdev requested a review from a team as a code owner February 1, 2025 18:13
@AThousandShips AThousandShips added this to the 4.4 milestone Feb 1, 2025
@tracefree
Copy link
Contributor

Thanks for the quick fix! I can confirm everything works as expected now in my MRP attached to #102279, also when I swap the long and short line.

@bruvzg bruvzg self-requested a review February 1, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants