Dont write escape code for zero movement
This commit is contained in:
parent
350060e0f6
commit
936a7a5f97
@ -210,6 +210,7 @@ func (self *Loop) SetCursorShape(shape CursorShapes, blink bool) {
|
||||
}
|
||||
|
||||
func (self *Loop) MoveCursorHorizontally(amt int) {
|
||||
if amt != 0 {
|
||||
suffix := "C"
|
||||
if amt < 0 {
|
||||
suffix = "D"
|
||||
@ -217,8 +218,10 @@ func (self *Loop) MoveCursorHorizontally(amt int) {
|
||||
}
|
||||
self.QueueWriteString(fmt.Sprintf("\x1b[%d%s", amt, suffix))
|
||||
}
|
||||
}
|
||||
|
||||
func (self *Loop) MoveCursorVertically(amt int) {
|
||||
if amt != 0 {
|
||||
suffix := "B"
|
||||
if amt < 0 {
|
||||
suffix = "A"
|
||||
@ -226,6 +229,7 @@ func (self *Loop) MoveCursorVertically(amt int) {
|
||||
}
|
||||
self.QueueWriteString(fmt.Sprintf("\x1b[%d%s", amt, suffix))
|
||||
}
|
||||
}
|
||||
|
||||
func (self *Loop) ClearToEndOfScreen() {
|
||||
self.QueueWriteString("\x1b[J")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user