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

shape_until_cursor does not handle single wrapped line properly #329

Open
carlosdp opened this issue Nov 21, 2024 · 1 comment · May be fixed by #330
Open

shape_until_cursor does not handle single wrapped line properly #329

carlosdp opened this issue Nov 21, 2024 · 1 comment · May be fixed by #330

Comments

@carlosdp
Copy link

Currently, if you have a single line that is wrapped beyond the editor view, it isn't possible to scroll down to view that text.

I've identified the issue to be in this block. Because of d0b4b46 this logic uses the line index, which will always be 0 and equal the scroll index for a single wrapped line, thus never triggering this behavior. Scrolling works correctly if there are two or more lines, even when wrapped beyond the view in the same way.

https://github.com/pop-os/cosmic-text/blame/1f4065c1c3399efad58841082212f7c039b58480/src/buffer.rs#L343-L359

I'm trying to figure out a fix myself, but I'm brand new to this codebase and don't yet understand the change introduced in d0b4b4 or why it is important, so might be faster for someone more versed.

@carlosdp carlosdp linked a pull request Nov 21, 2024 that will close this issue
@carlosdp
Copy link
Author

Made an attempt at a fix in #330

Not sure that's the best possible way to do it, but it seems to work properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant