diff options
Diffstat (limited to 'src/tui/light.go')
-rw-r--r-- | src/tui/light.go | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/tui/light.go b/src/tui/light.go index c19c8dca..5159aafe 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -182,10 +182,18 @@ func (r *LightRenderer) Init() { if r.fullscreen { r.smcup() } else { - r.csi("J") + // We assume that --no-clear is used for repetitive relaunching of fzf. + // So we do not clear the lower bottom of the screen. + if r.clearOnExit { + r.csi("J") + } y, x := r.findOffset() r.mouse = r.mouse && y >= 0 - if x > 0 { + // When --no-clear is used for repetitive relaunching, there is a small + // time frame between fzf processes where the user keystrokes are not + // captured by either of fzf process which can cause x offset to be + // increased and we're left with unwanted extra new line. + if x > 0 && r.clearOnExit { r.upOneLine = true r.makeSpace() } @@ -200,7 +208,7 @@ func (r *LightRenderer) Init() { r.csi(fmt.Sprintf("%dA", r.MaxY()-1)) r.csi("G") r.csi("K") - // r.csi("s") + r.csi("s") if !r.fullscreen && r.mouse { r.yoffset, _ = r.findOffset() } @@ -586,10 +594,8 @@ func (r *LightRenderer) Close() { } r.csi("J") } - } else if r.fullscreen { - r.csi("G") - } else { - r.move(r.height, 0) + } else if !r.fullscreen { + r.csi("u") } if r.mouse { r.csi("?1000l") |