summaryrefslogtreecommitdiff
path: root/src/tui
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-12-02 22:25:23 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-12-02 22:25:23 +0900
commite182d3db7a5fc6947741c635333fb1b9ba209910 (patch)
tree1db4660e6cba54bbbc99512df99f71e8f8327fd0 /src/tui
parent3e6e0528a65447129994d8abb9e12b88a2fce91f (diff)
downloadfzf-e182d3db7a5fc6947741c635333fb1b9ba209910.tar.gz
Fix line wrap toggle when switching between screens
Fix #4099
Diffstat (limited to 'src/tui')
-rw-r--r--src/tui/light.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/tui/light.go b/src/tui/light.go
index 054c23a3..3c930e26 100644
--- a/src/tui/light.go
+++ b/src/tui/light.go
@@ -73,11 +73,15 @@ func (r *LightRenderer) csi(code string) string {
func (r *LightRenderer) flush() {
if r.queued.Len() > 0 {
- fmt.Fprint(r.ttyout, "\x1b[?7l\x1b[?25l"+r.queued.String()+"\x1b[?25h\x1b[?7h")
+ r.flushRaw("\x1b[?7l\x1b[?25l" + r.queued.String() + "\x1b[?25h\x1b[?7h")
r.queued.Reset()
}
}
+func (r *LightRenderer) flushRaw(sequence string) {
+ fmt.Fprint(r.ttyout, sequence)
+}
+
// Light renderer
type LightRenderer struct {
closed *util.AtomicBool
@@ -655,11 +659,13 @@ func (r *LightRenderer) mouseSequence(sz *int) Event {
}
func (r *LightRenderer) smcup() {
- r.csi("?1049h")
+ r.flush()
+ r.flushRaw("\x1b[?1049h")
}
func (r *LightRenderer) rmcup() {
- r.csi("?1049l")
+ r.flush()
+ r.flushRaw("\x1b[?1049l")
}
func (r *LightRenderer) Pause(clear bool) {