ratatui-org / ratatui

Rust library that's all about cooking up terminal user interfaces (TUIs) 👨‍🍳🐀
https://ratatui.rs
MIT License
8.86k stars 269 forks source link

refactor(cell): reset instead of applying default #1127

Closed EdJoPaTo closed 1 month ago

EdJoPaTo commented 1 month ago

Using reset is clearer to me what actually happens. On the other case a struct is created to override the old one completely which basically does the same in a less clear way.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.3%. Comparing base (fadc73d) to head (11d0238). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1127 +/- ## ======================================= - Coverage 94.3% 94.3% -0.1% ======================================= Files 61 61 Lines 14768 14771 +3 ======================================= - Hits 13935 13930 -5 - Misses 833 841 +8 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

EdJoPaTo commented 1 month ago

As an alternative, what about adding a Buffer::reset_range() method - something like:

buffer.reset_range(Position(x, y)..Position(x1, y1));

Probably unnecessary over-engineering (this PR is approved without that change)

Guess that would be neat for #1122. And probably out of scope for this PR.