Skip to content

Commit

Permalink
perf(cellbuf): readd cuu1 optimization using reverse index
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Feb 4, 2025
1 parent 49d665c commit fc820b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cellbuf/screen.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func relativeCursorMove(s *Screen, fx, fy, tx, ty int, overwrite, useTabs bool)
if cuu := ansi.CursorUp(n); yseq == "" || len(cuu) < len(yseq) {
yseq = cuu
}
if n == 1 && fy-1 > 0 {
// TODO: Ensure we're not unintentionally scrolling the screen up.
yseq = ansi.ReverseIndex
}
}

seq.WriteString(yseq)
Expand Down

0 comments on commit fc820b7

Please sign in to comment.