summaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-08-08 21:32:58 +1000
committerJesse Duffield <jessedduffield@gmail.com>2022-08-11 21:24:16 +1000
commit225c563c630e8771c2c6741c78e8a427b3283f58 (patch)
tree315d535574b1e1aab2696c258427b3c5dcc12b30 /vendor
parent77881a9c7d24bb11bc74abff35d94397fd4ccb67 (diff)
another integration test
Diffstat (limited to 'vendor')
-rw-r--r--vendor/github.com/jesseduffield/gocui/view.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/github.com/jesseduffield/gocui/view.go b/vendor/github.com/jesseduffield/gocui/view.go
index 8ec290176..95c7ef4b1 100644
--- a/vendor/github.com/jesseduffield/gocui/view.go
+++ b/vendor/github.com/jesseduffield/gocui/view.go
@@ -465,6 +465,14 @@ func (v *View) Cursor() (x, y int) {
return v.cx, v.cy
}
+func (v *View) CursorX() int {
+ return v.cx
+}
+
+func (v *View) CursorY() int {
+ return v.cy
+}
+
// SetOrigin sets the origin position of the view's internal buffer,
// so the buffer starts to be printed from this point, which means that
// it is linked with the origin point of view. It can be used to
@@ -1235,6 +1243,13 @@ func (v *View) SelectedLineIdx() int {
return seletedLineIdx
}
+// expected to only be used in tests
+func (v *View) SelectedLine() string {
+ line := v.lines[v.SelectedLineIdx()]
+ str := lineType(line).String()
+ return strings.Replace(str, "\x00", " ", -1)
+}
+
func (v *View) SelectedPoint() (int, int) {
cx, cy := v.Cursor()
ox, oy := v.Origin()