Skip to content
Myr

Fix trailing ␊ not rendered with '--read0 --no-multi-line'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

https://github.com/junegunn/fzf/pull/4334#issue-2966013714 # Should display foo␊ echo -en "foo\n" | fzf --read0 --no-multi-line

authored by Junegunn Choi · committed by Junegunn Choi · parent 9ffc2c7 · Browse files · 2 files+6 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+6 added−1 removed

  • tests:+5 added−0 removed
  • other:+1 added−1 removed

2 files+6 added−1 removed

modified:src/terminal.go+1 added-1 removed
3142 unmodified lines
3143 wrapped = false3144 wasWrapped = true3145 }31463147 if len(line) > 0 && line[len(line)-1] == '\n' {3147 if len(line) > 0 && line[len(line)-1] == '\n' && lineOffset < len(lines)-1 {3148 line = line[:len(line)-1]3149 } else {3150 wrapped = true3151 }
3214 unmodified lines
modified:test/test_core.rb+5 added
1929 unmodified lines
1930 tmux.until { |lines| assert lines.any_include?('foo') }1931 tmux.send_keys :Space1932 tmux.until { |lines| assert lines.any_include?('bar') }1933 end19341935 def test_trailing_new_line1936 tmux.send_keys %(echo -en "foo\n" | fzf --read0 --no-multi-line), :Enter1937 tmux.until { |lines| assert_includes lines, '> foo␊' }1938 end1939end