mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-09 17:53:56 +00:00
Fix failing test case
This commit is contained in:
parent
82b46726fc
commit
821fc9feed
@ -1247,6 +1247,7 @@ func parsePreviewWindow(opts *previewOpts, input string) {
|
||||
if len(alternative) > 0 {
|
||||
alternativeOpts := *opts
|
||||
opts.alternative = &alternativeOpts
|
||||
opts.alternative.hidden = false
|
||||
opts.alternative.alternative = nil
|
||||
parsePreviewWindow(opts.alternative, alternative)
|
||||
}
|
||||
|
@ -877,9 +877,6 @@ func (t *Terminal) resizeWindows() {
|
||||
if previewVisible {
|
||||
var resizePreviewWindows func(previewOpts previewOpts)
|
||||
resizePreviewWindows = func(previewOpts previewOpts) {
|
||||
if previewOpts.hidden {
|
||||
return
|
||||
}
|
||||
hasThreshold := previewOpts.threshold > 0 && previewOpts.alternative != nil
|
||||
createPreviewWindow := func(y int, x int, w int, h int) {
|
||||
pwidth := w
|
||||
@ -930,7 +927,9 @@ func (t *Terminal) resizeWindows() {
|
||||
case posUp, posDown:
|
||||
pheight := calculateSize(height, previewOpts.size, minHeight, minPreviewHeight, verticalPad)
|
||||
if hasThreshold && pheight < previewOpts.threshold {
|
||||
if !previewOpts.alternative.hidden {
|
||||
resizePreviewWindows(*previewOpts.alternative)
|
||||
}
|
||||
return
|
||||
}
|
||||
if previewOpts.position == posUp {
|
||||
@ -945,8 +944,9 @@ func (t *Terminal) resizeWindows() {
|
||||
case posLeft, posRight:
|
||||
pwidth := calculateSize(width, previewOpts.size, minWidth, 5, 4)
|
||||
if hasThreshold && pwidth < previewOpts.threshold {
|
||||
fmt.Println("Alternative", (*previewOpts.alternative).position == posDown)
|
||||
if !previewOpts.alternative.hidden {
|
||||
resizePreviewWindows(*previewOpts.alternative)
|
||||
}
|
||||
return
|
||||
}
|
||||
if previewOpts.position == posLeft {
|
||||
|
Loading…
Reference in New Issue
Block a user