summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-02-01 15:46:42 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-02-01 15:46:42 +0900
commitd373cf89c7fbfbec30e58baf78e94dd243f0e82d (patch)
tree88d64e1d73fc2ea176b9ede6d9355db1c02dc88d
parentdd886d22f0b95700ece24954ac00f6e2628226f1 (diff)
Retain preview window on resize after 'preview' action
-rw-r--r--src/terminal.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/terminal.go b/src/terminal.go
index a1547ffb..c82183d3 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -293,6 +293,7 @@ type Terminal struct {
lastFocus int32
areaLines int
areaColumns int
+ forcePreview bool
}
type selectedItem struct {
@@ -1254,6 +1255,7 @@ func (t *Terminal) adjustMarginAndPadding() (int, int, [4]int, [4]int) {
}
func (t *Terminal) resizeWindows(forcePreview bool) {
+ t.forcePreview = forcePreview
screenWidth, screenHeight, marginInt, paddingInt := t.adjustMarginAndPadding()
width := screenWidth - marginInt[1] - marginInt[3]
height := screenHeight - marginInt[0] - marginInt[2]
@@ -2316,7 +2318,7 @@ func (t *Terminal) processTabs(runes []rune, prefixWidth int) (string, int) {
}
func (t *Terminal) printAll() {
- t.resizeWindows(false)
+ t.resizeWindows(t.forcePreview)
t.printList()
t.printPrompt()
t.printInfo()