-
Notifications
You must be signed in to change notification settings - Fork 414
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
New fix for area does not work with WRAP #5507
Comments
It's a known limitation. Wrapping mode requires rendering each line internally for measuring the size of the bounding box, and that for each key stroke! I doubt that can be improved performance-wise. Wrapping mode is not usable for huge content like that in @qtxie Do you see any better way than the current one? |
I have seen similar situations solved recalculating just the areas interested from the change and keeping all the other calculated parts. I don't know if here it could apply. |
In the native View backends, we don't manage the widgets, the OS does. So for I think it can be solved in different way, just providing a way to disable the scrollbars auto-activation feature, that will give you back the wanted performance, but the area would loose the ability to turn scrollbar on/off automatically depending on the content. |
Understood. I don't need automation for the scollbars, and also I can fake it in some way calculating the length of the text with rough precision. So ON/OFF automation is not a required feature. I have a small request while working on this part of VID. My application would need positioning the caret so the text scrolls to the new requested character position. Could this be implemented: red/REP#76 please? |
New The following modified code would now give satisfying performances:
|
It should be possible to override I don't think we'll go further than that for |
I agree, Back to the cursor position: During the years we (community) have talked about 2 solutions:
The scroll to the position of the selection is an important part of this request: when you search for a text and find it, you need to position to corresponding line and word. This happen either when you set the cursor to the start of found element or when you select the found text |
A small report on your fix:
|
No. I don't see a faster one. |
Improve the code. We can break the loop earlier as we don't care about the horizontal bar when it's WRAP mode. |
Could I ask why if I delete a line on the top, this happens very slow and if I do it at the bottom of the text, it happens at the speed of light? Which is the calculation that in this situation runs for every character or line from the current position to the end that cannot be interrupted? (Also note: no-auto-sb has not been merged/implemented in the main branch) |
@GiuseppeChillemi Do you know where the slowness happens? on Red side or the edit control? |
I don't know what Red does on line deletion. Specifically I don't know what happens between the hitting of the DEL key, the disappearing of the selected line and the redrawing of the current visibile area with the remaining text. Is It an all on the OS side or Red internal code interacts with the control during this process? 🤷🏻 |
Describe the bug
Use WRAP and the slowness returns. It happens at each key press too.
To reproduce
Run this code:
Platform version
Red commit: b26ec93
The text was updated successfully, but these errors were encountered: