mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-12-31 14:01:47 +00:00
Disallow dragging the wrong sides of the border
This commit is contained in:
parent
6c9025ff17
commit
3fc0bd26a5
@ -4722,7 +4722,18 @@ func (t *Terminal) Loop() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Preview border dragging (resizing)
|
// 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 {
|
if pborderDragging {
|
||||||
previewWidth := t.pwindow.Width() + borderColumns(t.activePreviewOpts.border, t.borderWidth)
|
previewWidth := t.pwindow.Width() + borderColumns(t.activePreviewOpts.border, t.borderWidth)
|
||||||
previewHeight := t.pwindow.Height() + borderLines(t.activePreviewOpts.border)
|
previewHeight := t.pwindow.Height() + borderLines(t.activePreviewOpts.border)
|
||||||
|
Loading…
Reference in New Issue
Block a user