From ee3916be17a340205875f9ccfaf71a1683a2fdf9 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 2 Jan 2025 16:24:46 +0900 Subject: Border around the input section (prompt + info) Close #4154 --- test/test_go.rb | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/test_go.rb b/test/test_go.rb index 1042bfcd..89d32628 100755 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -2646,7 +2646,7 @@ class TestGoFZF < TestBase end def test_change_preview_window - tmux.send_keys "seq 1000 | #{FZF} --preview 'echo [[{}]]' --preview-window border-none --bind '" \ + tmux.send_keys "seq 1000 | #{FZF} --preview 'echo [[{}]]' --no-preview-border --bind '" \ 'a:change-preview(echo __{}__),' \ 'b:change-preview-window(down)+change-preview(echo =={}==)+change-preview-window(up),' \ 'c:change-preview(),d:change-preview-window(hidden),' \ @@ -3449,6 +3449,81 @@ class TestGoFZF < TestBase BLOCK tmux.until { assert_block(block, _1) } end + + + def test_list_border_and_label + tmux.send_keys %(seq 100 | #{FZF} --border rounded --list-border double --list-label list --list-label-pos 2:bottom --header-lines 3 --query 1 --padding 1,2), :Enter + block = <<~BLOCK + │ ║ 11 + │ ║ > 10 + │ ║ 3 + │ ║ 2 + │ ║ 1 + │ ║ 19/97 ─ + │ ║ > 1 + │ ╚list══════ + │ + ╰────────────── + BLOCK + tmux.until { assert_block(block, _1) } + end + + def test_input_border_and_label + tmux.send_keys %(seq 100 | #{FZF} --border rounded --input-border bold --input-label input --input-label-pos 2 --header-lines 3 --query 1 --padding 1,2), :Enter + block = <<~BLOCK + │ 11 + │ > 10 + │ 3 + │ 2 + │ 1 + │ ┏input━━━━━ + │ ┃ 19/97 + │ ┃ > 1 + │ ┗━━━━━━━━━━ + │ + ╰────────────── + BLOCK + tmux.until { assert_block(block, _1) } + end + + def test_list_input_border_and_label + tmux.send_keys %( + seq 100 | #{FZF} --border rounded --list-border double --input-border bold --list-label-pos 2:bottom --input-label-pos 2 --header-lines 3 --query 1 --padding 1,2 \ + --bind 'start:transform-input-label(echo INPUT)+transform-list-label(echo LIST)' \ + --bind 'space:change-input-label( input )+change-list-label( list )' + ).strip, :Enter + block = <<~BLOCK + │ ║ 11 + │ ║ > 10 + │ ║ 3 + │ ║ 2 + │ ║ 1 + │ ╚LIST═════ + │ ┏INPUT━━━━ + │ ┃ 19/97 + │ ┃ > 1 + │ ┗━━━━━━━━━ + │ + ╰───────────── + BLOCK + tmux.until { assert_block(block, _1) } + tmux.send_keys :Space + block = <<~BLOCK + │ ║ 11 + │ ║ > 10 + │ ║ 3 + │ ║ 2 + │ ║ 1 + │ ╚ list ═══ + │ ┏ input ━━ + │ ┃ 19/97 + │ ┃ > 1 + │ ┗━━━━━━━━━ + │ + ╰───────────── + BLOCK + tmux.until { assert_block(block, _1) } + end end module TestShell -- cgit v1.2.3