Now, only cells that have been used are cleared. This is achieved by
using a "occupied" memo on the Row itself. The value, `occ`, is updated
wherever the Row is accessed mutably, and it's cleared to zero in
Row::reset.
The tests for grid scroll_up and scroll_down were updated to include a
test on the value `occ` and slightly refactored, but are otherwise
equivalent to the previous implementation of those tests.
Because of the change to the `Row` struct, the ref tests were updated so
Deserialization keeps working as expected.
Some tests are still not passing, though.
A migration script was added to migrate serialized grids from
pre-scrollback to the current format. The script is included with this
commit for completeness, posterity, and as an example to be used in the
future.
A few tests in grid/tests.rs were removed due to becoming irrelevant.
When a scroll region is active with the cursor below the bottom of the
region, newlines should not cause the region to scroll.
A ref test was added for this situation to prevent regressions.
Thanks @hiciu for reporting and @nicm for the test case.
Resolves#745.