[feature request] Ability to retrieve regions from TextView #73
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: tslocum/cview#73
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
It would be great to be able to retrieve all or one region from Textview (not just its text).
I'm not talking about
GetTextRegion(regionID)
that return the text contained in a specific region but:GetRegions() []*cview.textViewRegion
: Return all textViewRegionGetRegion(regionID string) *cview.textViewRegion
: Return a textViewRegion that match the provided regionID. And I want to potentially add other custom code when clicks happen.The use case for me is that I want to override the mouseHandler for a textview that has a long text with many regions.
Left click right now seems to select only the first displayed region and not the clicked one.
Even if that might be a bug in the textview mouse handler, I think it would be great to be able to retrieve regions (at least all of them) and use
FromX
,FromY
,ToX
,ToY
variables.Will you please share a demo that reproduces this? Region clicking seems to work in my limited testing.
I think I found the reason.
See the example based on demo code:
When running this and using left click anywhere in the terminal, only the first region is selected and highlighted for me.
By changing the text to:
By removing the "closing" tags (
[""]
), it seems to work as expected so I'm guessing the issue is around those tags :)Thanks again for reporting this. This was fixed upstream in tview, so I've merged their fix.
If you still neeed additional TextView methods, please open a new issue.