mirror of
https://github.com/rivo/tview.git
synced 2026-04-29 06:45:56 +03:00
[GH-ISSUE #958] Bug in TextArea Select #704
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#704
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 @eeeXun on GitHub (Mar 12, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/958
Given the following code, you can press
C-qto see the selection range. I want to select all text, sotextArea.Select(0, len(textArea.GetText()))The bug is when your text is too long to fit on a line in terminal.

This could not be solved even I increase the value of second parameter in
Select.textArea.Select(0, 10000)@naviji commented on GitHub (Mar 31, 2024):
I'm able to reproduce this. I'll see if I can fix it.
@naviji commented on GitHub (Apr 1, 2024):
I see that the Ctrl-L key can also be used to select the entire text.
For some reason selecting via Ctrl-L doesn't seem to trigger the selection issue. Does that help you?
@eeeXun commented on GitHub (Apr 1, 2024):
@naviji Hi, thanks for your help.
Actually, my problem is I want to use
TextArea.Replaceinstead ofTextArea.SetTextto reserve the undo history. (I want to clear the text,textArea.Replace(0, len(textArea.GetText()), ""))When I call
TextArea.Replace, it produces the similar problem as mentioned above. So I trace the code and find this function callsTextArea.Select.That's why I report the bug in
TextArea.Select@rivo commented on GitHub (Apr 2, 2024):
Hi everyone, thanks for reporting this bug. The latest commit should fix this.