-
Notifications
You must be signed in to change notification settings - Fork 814
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
Investigate reducing TextArea updates #4086
Comments
I think this would be incredibly difficult to implement within the TextArea itself unless we opted for a diffing approach, and if we're doing that, it'd probably be better to do it at the Textual level somehow. There are just so many things that can result in lines changing outwith the line that is currently being edited (syntax highlighting, wrapping, an edit can result in scrollbars appearing which can change wrapping, some edits can influence lines below them, and so on...). |
Could you let me know your thoughts @willmcgugan? |
Ideally the widget can calculate which areas change, but as you said the TextArea makes that impractical. I think we could do a diffing approach at the Textual level. When we render the widget we can store the rendered strips somewhere, then when we render a subsequent frame we could compare them line by line and only refresh lines which have changed. This wouldn't be very precise. If we have a flashing cursor it would update a line rather than a single cell, but it would be better that updating the entire widget. I think this should be an opt-in thing for line API widgets. May |
@davep @rodrigogiraoserrao Please consider tackling this. Let me know if you want to discuss your approach beforehand. |
The TextArea tends to refresh the entire widget on update. We should investigate the possibility of either programatically figuring out changed regions, or doing some kind of automatic comparison with the previous frame.
The text was updated successfully, but these errors were encountered: