diff --git a/src/terminal.go b/src/terminal.go index 30f6992b..6c30ee9b 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -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() } diff --git a/test/test_preview.rb b/test/test_preview.rb index 0da1a88b..616074c3 100644 --- a/test/test_preview.rb +++ b/test/test_preview.rb @@ -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