summaryrefslogtreecommitdiff
path: root/src/tui/light.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2022-09-08 01:01:22 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2022-09-28 23:22:31 +0900
commit22cbd9fa58512ffdcc975bab37a55467d5e10968 (patch)
treebddf8d579d8fe88abc4a6014f1a0e936d48be7c7 /src/tui/light.go
parent984049586a5e5409131e4cb4600115f4a6b9c669 (diff)
downloadfzf-22cbd9fa58512ffdcc975bab37a55467d5e10968.tar.gz
Implement height range (--height ~[VALUE][%])
Close #2953
Diffstat (limited to 'src/tui/light.go')
-rw-r--r--src/tui/light.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tui/light.go b/src/tui/light.go
index 0546caa8..20b7b9d5 100644
--- a/src/tui/light.go
+++ b/src/tui/light.go
@@ -189,6 +189,10 @@ func (r *LightRenderer) Init() {
}
}
+func (r *LightRenderer) Resize(maxHeightFunc func(int) int) {
+ r.maxHeightFunc = maxHeightFunc
+}
+
func (r *LightRenderer) makeSpace() {
r.stderr("\n")
r.csi("G")
@@ -676,6 +680,9 @@ func (r *LightRenderer) MaxX() int {
}
func (r *LightRenderer) MaxY() int {
+ if r.height == 0 {
+ r.updateTerminalSize()
+ }
return r.height
}