From f7938a79e922ea4ba8c62e36463e5f289b7bc0ef Mon Sep 17 00:00:00 2001 From: Antonio Verni Date: Mon, 19 Jun 2023 12:19:54 +0200 Subject: [PATCH] add cursorIndex getter to textview --- textview.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/textview.go b/textview.go index f8035c50..95622f3b 100644 --- a/textview.go +++ b/textview.go @@ -233,6 +233,11 @@ func (t *TextView) SetCursorIndex(i int) { t.cursorIndex = i } +// GetCursor returns cursor position. +func (t *TextView) GetCursorIndex() int { + return t.cursorIndex +} + // SetHighlightColor sets the region highlight color. func (t *TextView) SetHighlightColor(c tcell.Color) { t.highlightColor = c