mirror of
https://github.com/nushell/nushell.git
synced 2024-11-22 00:13:21 +01:00
a9c2349ada
`explore` has 3 cursor-related structs that are extensively used to track the currently shown "window" of the data being shown. I was finding the cursor code quite difficult to follow, so this PR: - rewrites the base `Cursor` struct from scratch, with some tests - makes big changes to `WindowCursor` - renames `XYCursor` to `WindowCursor2D` - makes some of the cursor functions fallible as a start towards better error handling - changes lots of function names to things that I find more intuitive - adds comments, including ASCII diagrams to explain how the cursors work More work could be done (I'd like to review/change more function names in `WindowCursor` and `WindowCursor2D` and add more tests), but this is the limit of what I can get done in a weekend. I think this part of the code is in a better place now. # Testing performed I did a lot of manual testing in the record view and binary viewer, moving around with arrow keys / page up+down / home+end. This can definitely wait until after the release freeze, this area has very few automated tests and it'd be good to let the changes bake a bit. |
||
---|---|---|
.. | ||
src | ||
.gitignore | ||
Cargo.toml | ||
LICENSE |