Fix test failure

This commit is contained in:
Junegunn Choi
2026-02-19 21:30:46 +09:00
parent 4a195e6323
commit 4a684b6c78
2 changed files with 7 additions and 7 deletions

View File

@@ -4369,7 +4369,7 @@ Loop:
prefixWidth := t.pwindow.X()
var url *url
_, _, ansi = extractColor(subLine, ansi, func(str string, ansi *ansiState) bool {
if fillRet == tui.FillNextLine {
if len(str) > 0 && fillRet == tui.FillNextLine {
printWrapSign()
prefixWidth = t.pwindow.X()
}

View File

@@ -587,8 +587,8 @@ class TestPreview < TestInteractive
tmux.send_keys %(seq 1 | #{FZF} --preview 'echo -e "\\x1b[33m1234567890 \\x1b[mhello"; echo -e "\\x1b[33m1234567890 \\x1b[mhello"' --preview-window 10,wrap-word), :Enter
tmux.until do |lines|
assert_equal 1, lines.match_count
assert_equal 2, lines.count { |line| line.include?('│ 1234567890 │') }
assert_equal 2, lines.count { |line| line.include?('│ ↳ hello │') }
assert_equal(2, lines.count { |line| line.include?('│ 1234567890 │') })
assert_equal(2, lines.count { |line| line.include?('│ ↳ hello │') })
end
end
@@ -596,8 +596,8 @@ class TestPreview < TestInteractive
tmux.send_keys %(seq 1 | #{FZF} --preview 'echo -e "\\x1b[33m1234567890 \\x1b[mhello"; echo -e "\\x1b[33m1234567890 \\x1b[mhello"' --preview-window 2,wrap-word), :Enter
tmux.until do |lines|
assert_equal 1, lines.match_count
assert_equal 2, lines.count { |line| line.include?('│ 12 │') }
assert_equal 0, lines.count { |line| line.include?('│ h') }
assert_equal(2, lines.count { |line| line.include?('│ 12 │') })
assert_equal(0, lines.count { |line| line.include?('│ h') })
end
end
@@ -605,8 +605,8 @@ class TestPreview < TestInteractive
tmux.send_keys %(seq 1 | #{FZF} --preview 'echo -e "\\x1b[33m1234567890 \\x1b[mhello"; echo -e "\\x1b[33m1234567890 \\x1b[mhello"' --preview-window 1,wrap-word), :Enter
tmux.until do |lines|
assert_equal 1, lines.match_count
assert_equal 2, lines.count { |line| line.include?('│ 1 │') }
assert_equal 0, lines.count { |line| line.include?('│ h') }
assert_equal(2, lines.count { |line| line.include?('│ 1 │') })
assert_equal(0, lines.count { |line| line.include?('│ h') })
end
end
end