mirror of
https://github.com/nushell/nushell.git
synced 2025-08-24 13:46:13 +02:00
Limit drilling down inside explore
(#13293)
This PR fixes an issue with `explore` where you can "drill down" into the same value forever. For example: 1. Run `ls | explore` 2. Press Enter to enter cursor mode 3. Press Enter again to open the selected string in a new layer 4. Press Enter again to open that string in a new layer 5. Press Enter again to open that string in a new layer 6. Repeat and eventually you have a bajillion layers open with the same string IMO it only makes sense to "drill down" into lists and records. In a separate commit I also did a little refactoring, cleaning up naming and comments.
This commit is contained in:
@@ -65,7 +65,7 @@ impl ViewCommand for NuCmd {
|
||||
let mut view = RecordView::new(columns, values);
|
||||
|
||||
if is_record {
|
||||
view.set_orientation_current(Orientation::Left);
|
||||
view.set_top_layer_orientation(Orientation::Left);
|
||||
}
|
||||
|
||||
Ok(NuView::Records(view))
|
||||
|
@@ -58,11 +58,11 @@ impl ViewCommand for TableCmd {
|
||||
let mut view = RecordView::new(columns, data);
|
||||
|
||||
if is_record {
|
||||
view.set_orientation_current(Orientation::Left);
|
||||
view.set_top_layer_orientation(Orientation::Left);
|
||||
}
|
||||
|
||||
if let Some(o) = self.settings.orientation {
|
||||
view.set_orientation_current(o);
|
||||
view.set_top_layer_orientation(o);
|
||||
}
|
||||
|
||||
if self.settings.turn_on_cursor_mode {
|
||||
|
Reference in New Issue
Block a user