mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-14 14:23:47 -05:00
Fix {show,hide,toggle}-input and add test cases
This commit is contained in:
@@ -2533,7 +2533,7 @@ func (t *Terminal) printInfoImpl() {
|
|||||||
|
|
||||||
func (t *Terminal) resizeIfNeeded() bool {
|
func (t *Terminal) resizeIfNeeded() bool {
|
||||||
// Check if input border is used and input has changed
|
// Check if input border is used and input has changed
|
||||||
if t.inputBorderShape.Visible() && t.inputWindow == nil && !t.inputless {
|
if t.inputBorderShape.Visible() && t.inputWindow == nil && !t.inputless || t.inputWindow != nil && t.inputless {
|
||||||
t.printAll()
|
t.printAll()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -5948,6 +5948,7 @@ func (t *Terminal) Loop() error {
|
|||||||
// Always just discard the change
|
// Always just discard the change
|
||||||
t.input = previousInput
|
t.input = previousInput
|
||||||
t.cx = len(t.input)
|
t.cx = len(t.input)
|
||||||
|
beof = false
|
||||||
} else {
|
} else {
|
||||||
t.truncateQuery()
|
t.truncateQuery()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -893,7 +893,7 @@ class TestLayout < TestInteractive
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_min_height_auto_no_input_reverse_list
|
def test_min_height_auto_no_input_reverse_list
|
||||||
tmux.send_keys %(seq 100 | #{FZF} --style full:sharp --layout reverse-list --no-input --height 1% --min-height 5+), :Enter
|
tmux.send_keys %(seq 100 | #{FZF} --style full:sharp --layout reverse-list --no-input --height 1% --min-height 5+ --bind a:show-input,b:hide-input,c:toggle-input), :Enter
|
||||||
|
|
||||||
block = <<~BLOCK
|
block = <<~BLOCK
|
||||||
┌─────────
|
┌─────────
|
||||||
@@ -905,6 +905,23 @@ class TestLayout < TestInteractive
|
|||||||
└─────────
|
└─────────
|
||||||
BLOCK
|
BLOCK
|
||||||
tmux.until { assert_block(block, it) }
|
tmux.until { assert_block(block, it) }
|
||||||
|
tmux.send_keys :a
|
||||||
|
block2 = <<~BLOCK
|
||||||
|
┌─────
|
||||||
|
│ > 1
|
||||||
|
│ 2
|
||||||
|
└─────
|
||||||
|
┌─────
|
||||||
|
│ >
|
||||||
|
└─────
|
||||||
|
BLOCK
|
||||||
|
tmux.until { assert_block(block2, it) }
|
||||||
|
tmux.send_keys :b
|
||||||
|
tmux.until { assert_block(block, it) }
|
||||||
|
tmux.send_keys :c
|
||||||
|
tmux.until { assert_block(block2, it) }
|
||||||
|
tmux.send_keys :c
|
||||||
|
tmux.until { assert_block(block, it) }
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_layout_reverse_list
|
def test_layout_reverse_list
|
||||||
|
|||||||
Reference in New Issue
Block a user