mirror of
https://github.com/rivo/tview.git
synced 2026-04-27 13:55:51 +03:00
[GH-ISSUE #565] Display large texts #414
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#414
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @inmylo on GitHub (Feb 10, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/565
From the issues I see, that it is not recommended to use a
textViewto display large texts, especially with colors. For example: #451Is there a fast & efficient way to display large texts? I could use terminal's native escape codes for colors.
There could be a way to simply display a scrollable text without any kind of parsing/processing, except mandatory things to not break a layout.
@rivo commented on GitHub (Feb 16, 2021):
#451 was just updated. Does this help you?
Using escape codes won't help speed things up.
tviewis built on top oftcellwhich uses a buffer for the characters to be displayed on screen. While escape codes are used bytcellin the last step to sync that buffer with the screen,tviewcannot bypass that buffer. SoTextViewwill always use color tags to achieve colorization, which means parsing them etc.Maybe writing a more efficient parser and keeping a better internal data structure for texts can help. But that's a big project and therefore in the far future (if at all). There are requests to add an editable widget (basically a text editor). I suppose that if I tackle that, I'll use the opportunity to think about how to deal with large texts there. (Good text editors are big projects by themselves, though, so that's a big "if".)
@inmylo commented on GitHub (Feb 21, 2021):
Looks better. At least RAM and CPU usage stays more or less the same