mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-02 14:10:32 +08:00
Use CHA for absolute horizontal cursor movement
Related: - #4858 - https://github.com/zellij-org/zellij/issues/5370
This commit is contained in:
+6
-3
@@ -256,9 +256,12 @@ func (r *LightRenderer) move(y int, x int) {
|
|||||||
} else if r.y > y {
|
} else if r.y > y {
|
||||||
r.csi(fmt.Sprintf("%dA", r.y-y))
|
r.csi(fmt.Sprintf("%dA", r.y-y))
|
||||||
}
|
}
|
||||||
r.stderr("\r")
|
// Use CHA instead of CR+CUF; Zellij misplaces the next character when
|
||||||
if x > 0 {
|
// CUF moves the cursor over cells that have not been written to yet.
|
||||||
r.csi(fmt.Sprintf("%dC", x))
|
if x == 0 {
|
||||||
|
r.stderr("\r")
|
||||||
|
} else {
|
||||||
|
r.csi(fmt.Sprintf("%dG", x+1))
|
||||||
}
|
}
|
||||||
r.y = y
|
r.y = y
|
||||||
r.x = x
|
r.x = x
|
||||||
|
|||||||
Reference in New Issue
Block a user