mirror of
https://github.com/junegunn/fzf.git
synced 2026-08-02 22:18:35 +08:00
Use DECSC/DECRC instead of CSI s/u
Honored by more terminals, e.g. fixes cursor restoration with --height --no-clear inside nvim terminal.
This commit is contained in:
+2
-5
@@ -232,7 +232,7 @@ func (r *LightRenderer) Init() error {
|
|||||||
r.csi("G")
|
r.csi("G")
|
||||||
r.csi("K")
|
r.csi("K")
|
||||||
if !r.clearOnExit && !r.fullscreen {
|
if !r.clearOnExit && !r.fullscreen {
|
||||||
r.csi("s")
|
r.stderr("\x1b7") // DECSC: save cursor position
|
||||||
}
|
}
|
||||||
if !r.fullscreen && r.mouse {
|
if !r.fullscreen && r.mouse {
|
||||||
r.yoffset, _ = r.findOffset()
|
r.yoffset, _ = r.findOffset()
|
||||||
@@ -250,7 +250,6 @@ func (r *LightRenderer) makeSpace() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *LightRenderer) move(y int, x int) {
|
func (r *LightRenderer) move(y int, x int) {
|
||||||
// w.csi("u")
|
|
||||||
if r.y < y {
|
if r.y < y {
|
||||||
r.csi(fmt.Sprintf("%dB", y-r.y))
|
r.csi(fmt.Sprintf("%dB", y-r.y))
|
||||||
} else if r.y > y {
|
} else if r.y > y {
|
||||||
@@ -1022,7 +1021,6 @@ func (r *LightRenderer) Clear() {
|
|||||||
if r.fullscreen {
|
if r.fullscreen {
|
||||||
r.csi("H")
|
r.csi("H")
|
||||||
}
|
}
|
||||||
// r.csi("u")
|
|
||||||
r.origin()
|
r.origin()
|
||||||
r.csi("J")
|
r.csi("J")
|
||||||
r.flush()
|
r.flush()
|
||||||
@@ -1045,7 +1043,6 @@ func (r *LightRenderer) Refresh() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *LightRenderer) Close() {
|
func (r *LightRenderer) Close() {
|
||||||
// r.csi("u")
|
|
||||||
if r.clearOnExit {
|
if r.clearOnExit {
|
||||||
if r.fullscreen {
|
if r.fullscreen {
|
||||||
r.rmcup()
|
r.rmcup()
|
||||||
@@ -1057,7 +1054,7 @@ func (r *LightRenderer) Close() {
|
|||||||
r.csi("J")
|
r.csi("J")
|
||||||
}
|
}
|
||||||
} else if !r.fullscreen {
|
} else if !r.fullscreen {
|
||||||
r.csi("u")
|
r.stderr("\x1b8") // DECRC: restore cursor position
|
||||||
}
|
}
|
||||||
if !r.showCursor {
|
if !r.showCursor {
|
||||||
r.csi("?25h")
|
r.csi("?25h")
|
||||||
|
|||||||
Reference in New Issue
Block a user