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 {
|
if len(alternative) > 0 {
|
||||||
alternativeOpts := *opts
|
alternativeOpts := *opts
|
||||||
opts.alternative = &alternativeOpts
|
opts.alternative = &alternativeOpts
|
||||||
|
opts.alternative.hidden = false
|
||||||
opts.alternative.alternative = nil
|
opts.alternative.alternative = nil
|
||||||
parsePreviewWindow(opts.alternative, alternative)
|
parsePreviewWindow(opts.alternative, alternative)
|
||||||
}
|
}
|
||||||
|
@ -877,9 +877,6 @@ func (t *Terminal) resizeWindows() {
|
|||||||
if previewVisible {
|
if previewVisible {
|
||||||
var resizePreviewWindows func(previewOpts previewOpts)
|
var resizePreviewWindows func(previewOpts previewOpts)
|
||||||
resizePreviewWindows = func(previewOpts previewOpts) {
|
resizePreviewWindows = func(previewOpts previewOpts) {
|
||||||
if previewOpts.hidden {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
hasThreshold := previewOpts.threshold > 0 && previewOpts.alternative != nil
|
hasThreshold := previewOpts.threshold > 0 && previewOpts.alternative != nil
|
||||||
createPreviewWindow := func(y int, x int, w int, h int) {
|
createPreviewWindow := func(y int, x int, w int, h int) {
|
||||||
pwidth := w
|
pwidth := w
|
||||||
@ -930,7 +927,9 @@ func (t *Terminal) resizeWindows() {
|
|||||||
case posUp, posDown:
|
case posUp, posDown:
|
||||||
pheight := calculateSize(height, previewOpts.size, minHeight, minPreviewHeight, verticalPad)
|
pheight := calculateSize(height, previewOpts.size, minHeight, minPreviewHeight, verticalPad)
|
||||||
if hasThreshold && pheight < previewOpts.threshold {
|
if hasThreshold && pheight < previewOpts.threshold {
|
||||||
resizePreviewWindows(*previewOpts.alternative)
|
if !previewOpts.alternative.hidden {
|
||||||
|
resizePreviewWindows(*previewOpts.alternative)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if previewOpts.position == posUp {
|
if previewOpts.position == posUp {
|
||||||
@ -945,8 +944,9 @@ func (t *Terminal) resizeWindows() {
|
|||||||
case posLeft, posRight:
|
case posLeft, posRight:
|
||||||
pwidth := calculateSize(width, previewOpts.size, minWidth, 5, 4)
|
pwidth := calculateSize(width, previewOpts.size, minWidth, 5, 4)
|
||||||
if hasThreshold && pwidth < previewOpts.threshold {
|
if hasThreshold && pwidth < previewOpts.threshold {
|
||||||
fmt.Println("Alternative", (*previewOpts.alternative).position == posDown)
|
if !previewOpts.alternative.hidden {
|
||||||
resizePreviewWindows(*previewOpts.alternative)
|
resizePreviewWindows(*previewOpts.alternative)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if previewOpts.position == posLeft {
|
if previewOpts.position == posLeft {
|
||||||
|
Loading…
Reference in New Issue
Block a user