summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-12-09 17:54:47 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-12-12 13:53:08 +0900
commit3fc0bd26a59c78beba62b610061db59b552e2e74 (patch)
tree159cc587471655891cbed3ea9557568f54b5d64d /src
parent6c9025ff17cedcdc78d6f353019cefd118c3cc7c (diff)
downloadfzf-3fc0bd26a59c78beba62b610061db59b552e2e74.tar.gz
Disallow dragging the wrong sides of the border
Diffstat (limited to 'src')
-rw-r--r--src/terminal.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/terminal.go b/src/terminal.go
index 59aff994..9de92e3c 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -4722,7 +4722,18 @@ func (t *Terminal) Loop() error {
}
// Preview border dragging (resizing)
- pborderDragging = me.Down && (pborderDragging || clicked && t.hasPreviewWindow() && t.pborder.Enclose(my, mx))
+ if !pborderDragging && clicked && t.hasPreviewWindow() && t.pborder.Enclose(my, mx) {
+ switch t.activePreviewOpts.position {
+ case posUp:
+ pborderDragging = my == t.pborder.Top()+t.pborder.Height()-1
+ case posDown:
+ pborderDragging = my == t.pborder.Top()
+ case posLeft:
+ pborderDragging = mx == t.pborder.Left()+t.pborder.Width()-1
+ case posRight:
+ pborderDragging = mx == t.pborder.Left()
+ }
+ }
if pborderDragging {
previewWidth := t.pwindow.Width() + borderColumns(t.activePreviewOpts.border, t.borderWidth)
previewHeight := t.pwindow.Height() + borderLines(t.activePreviewOpts.border)