nushell/crates/nu-explore/src
Reilly Wood a9c2349ada
Refactor explore cursor code (#12979)
`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.
2024-06-04 19:50:11 -07:00
..
commands explore: consolidate padding config, handle ByteStream, tweak naming+comments (#12915) 2024-05-20 22:03:21 +02:00
nu_common Make LS_COLORS functionality faster in explore, especially on Windows (#12984) 2024-06-05 07:43:12 +08:00
pager explore: adopt anyhow, support CustomValue, remove help system (#12692) 2024-05-01 17:34:37 -05:00
registry explore: adopt anyhow, support CustomValue, remove help system (#12692) 2024-05-01 17:34:37 -05:00
views Refactor explore cursor code (#12979) 2024-06-04 19:50:11 -07:00
default_context.rs Move explore command out of nu-command deps (#9421) 2023-06-14 01:18:36 +02:00
explore.rs Add sys subcommands (#12747) 2024-05-06 23:20:27 +00:00
lib.rs explore: consolidate padding config, handle ByteStream, tweak naming+comments (#12915) 2024-05-20 22:03:21 +02:00