Repository navigation
fix(renderer): don't trim final newline (because it can be intentional) - #1798
meowgorithm wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1798 +/- ##
==========================================
+ Coverage 59.35% 63.58% +4.23%
==========================================
Files 25 25
Lines 1341 1538 +197
==========================================
+ Hits 796 978 +182
- Misses 456 464 +8
- Partials 89 96 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
andrinoff
left a comment
There was a problem hiding this comment.
There's also a pre-existing bug that a view without a trailing newline loses its last line on exit. close moves to the last buffer row and erases below it, so the shell prompt overwrites that line. Maybe worth fixing here too
| // than on its last visible line. Frames taller than the screen | ||
| // have their top rows dropped, so their last visible row is the | ||
| // screen's. | ||
| y := frameArea.Dy() - 1 |
There was a problem hiding this comment.
parking at the frame's last row is correct, but for frames taller than the screen this now aligns the frame with the top of the terminal, and the existing per-frame full redraw then floods scrollback in tmux
|
|
||
| // Frames taller than the screen drop their top rows, so the parked cursor | ||
| // must land on the screen's last visible row, not beyond it. | ||
| func TestCursedRenderer_trailingBlankLinesTallFrame(t *testing.T) { |
There was a problem hiding this comment.
this checks the parked position but not that a second unchanged flush is a no-op. that's why the regression above was missed
Signed-off-by: drew <me@andrinoff.com>
3dd74a3 to
5617f4d
Compare
This revision maintains trailing newlines, because trailing blank lines can be a design choice. Prior to this change it was nearly impossible to keep them.
Worth testing this one thoroughly, per the removed comment in the code.