mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 21:35:54 +03:00
[GH-ISSUE #124] Feature request: Methods to manually get/set TextView.lineOffset #96
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#96
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 @albertito on GitHub (May 26, 2018).
Original GitHub issue: https://github.com/rivo/tview/issues/124
Hi!
I am using TextView to implement a "less with links", using regions and highlights, as part of a bigger application.
One think I keep running into is that I'd like to be able to manually get and set the lineOffset, so I can control the position from my application based on external input (and not only user's key movements).
This would also allow me to implement some usability tweaks (such as when the user presses "tab", I can highlight the next viewable region).
Do you think this would be reasonable?
Thanks!
@rivo commented on GitHub (May 28, 2018):
I added
ScrollTo()to theTextViewprimitive. Could you have a look and let me know if this works for you?@albertito commented on GitHub (Jul 25, 2018):
Thanks for implementing that!
It helps, but what do you think about adding a method like GetPosition to get the current row?
I think the two combined would let me implement the behaviour I am after.
Of course, I'm happy to send patches!
Thanks!
@rivo commented on GitHub (Jul 27, 2018):
You mean you need a function that returns the current scroll position? Like
GetScrollOffset()?@albertito commented on GitHub (Jul 28, 2018):
Yes, a function that returns t.lineOffset.
@rivo commented on GitHub (Jul 28, 2018):
I just added that function. See
GetScrollOffset().@albertito commented on GitHub (Jul 29, 2018):
Great, thanks a lot!
LANG=zh_CN.UTF-8breaks rendering #478