nushell/crates/nu-explore/src
paulie4 88d27fd607
explore: add more less key bindings and add Transition::None (#14468)
# Description
The `explore` command is `less`-like, but it's missing the `Emacs`
keybindings for up/down and PageUp/PageDown as well as the "q" to quit
out. When I looked into adding those additional keybindings, I noticed
there was a lot of duplicated code in the various views, so I refactored
the code into a new `trait CursorMoveHandler`. I also noticed that there
was an existing `TODO: should we add a noop transition instead of doing
Option<Transition> everywhere?` comment in the code. I went ahead and
implemented a new `Transition::None`, and that made the new `trait
CursorMoveHandler` code MUCH cleaner, in addition to making some of the
old code a little cleaner as well.

# User-Facing Changes
Users that are used to the keybindings for `less` should feel much more
comfortable using `explore`.

# Tests + Formatting
Unfortunately, there aren't any existing tests for the `explore`
command, so I didn't know where I should add new tests to cover my code
changes.

---------

Co-authored-by: paulie4 <203125+paulie4@users.noreply.github.com>
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2024-11-30 08:22:52 -06:00
..
commands explore: add more less key bindings and add Transition::None (#14468) 2024-11-30 08:22:52 -06:00
nu_common Make get_env_var return a reference to a Value (#13987) 2024-10-02 13:05:48 +02:00
pager explore: add more less key bindings and add Transition::None (#14468) 2024-11-30 08:22:52 -06:00
registry Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
views explore: add more less key bindings and add Transition::None (#14468) 2024-11-30 08:22:52 -06:00
default_context.rs Move explore command out of nu-command deps (#9421) 2023-06-14 01:18:36 +02:00
explore.rs Fix issue with ls | explore coloring of file names (#13952) 2024-09-29 14:03:56 -05:00
lib.rs remove terminal_size crate everywhere it makes sense (#14423) 2024-11-23 19:37:12 -08:00