mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-10 07:04:17 +00:00
aed60b9839
Reimplement Terminal::insert_before. The previous implementation would insert the new lines in chunks into the area between the top of the screen and the top of the (new) viewport. If the viewport filled the screen, there would be no area in which to insert lines, and the function would crash. The new implementation uses as much of the screen as it needs to, all the way up to using the whole screen. This commit: - adds a scrollback buffer to the `TestBackend` so that tests can inspect and assert the state of the scrollback buffer in addition to the screen - adds functions to `TestBackend` to assert the state of the scrollback - adds and updates `TestBackend` tests to test the behavior of the scrollback and the new asserting functions - reimplements `Terminal::insert_before`, including adding two new helper functions `Terminal::draw_lines` and `Terminal::scroll_up`. - updates the documentation for `Terminal::insert_before` to clarify some of the edge cases - updates terminal tests to assert the state of the scrollback buffer - adds a new test for the condition that causes the bug - adds a conversion constructor `Cell::from(char)` Fixes: https://github.com/ratatui/ratatui/issues/999 |
||
---|---|---|
.. | ||
backend_termion.rs | ||
state_serde.rs | ||
stylize.rs | ||
terminal.rs | ||
widgets_barchart.rs | ||
widgets_block.rs | ||
widgets_calendar.rs | ||
widgets_canvas.rs | ||
widgets_chart.rs | ||
widgets_gauge.rs | ||
widgets_list.rs | ||
widgets_paragraph.rs | ||
widgets_table.rs | ||
widgets_tabs.rs |