MCPcopy Create free account
hub / github.com/atomicgo/cursor / Move

Method Move

area.go:132–144  ·  view source on GitHub ↗

Move moves the cursor relative by x and y.

(x, y int)

Source from the content-addressed store, hash-verified

130
131// Move moves the cursor relative by x and y.
132func (area *Area) Move(x, y int) {
133 if x > 0 {
134 area.cursor.Right(x)
135 } else if x < 0 {
136 area.cursor.Left(-x)
137 }
138
139 if y > 0 {
140 area.Up(y)
141 } else if y < 0 {
142 area.Down(-y)
143 }
144}
145
146// ClearLinesUp clears n lines upwards from the current position and moves the cursor.
147func (area *Area) ClearLinesUp(n int) {

Callers 1

mainFunction · 0.95

Calls 4

UpMethod · 0.95
DownMethod · 0.95
RightMethod · 0.45
LeftMethod · 0.45

Tested by

no test coverage detected