mirror of
https://github.com/nushell/nushell.git
synced 2025-08-12 15:28:07 +02:00
explore
: pass config to views at creation time (#13312)
cc: @zhiburt This is an internal refactoring for `explore`. Previously, views inside `explore` were created with default/incorrect configuration and then the correct configuration was passed to them using a function called `setup()`. I believe this was because configuration was dynamic and could change while `explore` was running. After https://github.com/nushell/nushell/pull/10259, configuration can no longer be changed on the fly. So we can clean this up by removing `setup()` and passing configuration to views when they are created.
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
use crate::views::ViewConfig;
|
||||
|
||||
use super::pager::{Pager, Transition};
|
||||
use anyhow::Result;
|
||||
use nu_protocol::{
|
||||
@ -49,5 +51,6 @@ pub trait ViewCommand {
|
||||
engine_state: &EngineState,
|
||||
stack: &mut Stack,
|
||||
value: Option<Value>,
|
||||
config: &ViewConfig,
|
||||
) -> Result<Self::View>;
|
||||
}
|
||||
|
Reference in New Issue
Block a user