cleanup
This commit is contained in:
parent
684b259ee2
commit
fa3594bac8
|
@ -57,8 +57,6 @@ impl ViewCommand for TableCmd {
|
||||||
|
|
||||||
let mut view = RecordView::new(columns, data);
|
let mut view = RecordView::new(columns, data);
|
||||||
|
|
||||||
// todo: use setup instead ????
|
|
||||||
|
|
||||||
if is_record {
|
if is_record {
|
||||||
view.set_orientation_current(Orientation::Left);
|
view.set_orientation_current(Orientation::Left);
|
||||||
}
|
}
|
||||||
|
@ -67,32 +65,6 @@ impl ViewCommand for TableCmd {
|
||||||
view.set_orientation_current(o);
|
view.set_orientation_current(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if let Some(style) = self.settings.selected_cell_s {
|
|
||||||
// view.set_style_selected_cell(style);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if let Some(style) = self.settings.selected_column_s {
|
|
||||||
// view.set_style_selected_column(style);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if let Some(style) = self.settings.selected_row_s {
|
|
||||||
// view.set_style_selected_row(style);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if let Some(style) = self.settings.split_line_s {
|
|
||||||
// view.set_style_separator(style);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if let Some(p) = self.settings.padding_column_left {
|
|
||||||
// let c = view.get_padding_column();
|
|
||||||
// view.set_padding_column((p, c.1))
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if let Some(p) = self.settings.padding_column_right {
|
|
||||||
// let c = view.get_padding_column();
|
|
||||||
// view.set_padding_column((c.0, p))
|
|
||||||
// }
|
|
||||||
|
|
||||||
if self.settings.turn_on_cursor_mode {
|
if self.settings.turn_on_cursor_mode {
|
||||||
view.set_cursor_mode();
|
view.set_cursor_mode();
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,11 +69,6 @@ impl Command for Explore {
|
||||||
let nu_config = engine_state.get_config();
|
let nu_config = engine_state.get_config();
|
||||||
let style_computer = StyleComputer::from_config(engine_state, stack);
|
let style_computer = StyleComputer::from_config(engine_state, stack);
|
||||||
|
|
||||||
// let mut config = nu_config.explore.clone();
|
|
||||||
// include_nu_config(&mut config, &style_computer);
|
|
||||||
// update_config(&mut config, show_index, show_head);
|
|
||||||
// default_config(&mut config);
|
|
||||||
|
|
||||||
let mut explore_config = ExploreConfig::from_nu_config(&nu_config);
|
let mut explore_config = ExploreConfig::from_nu_config(&nu_config);
|
||||||
explore_config.table.show_header = show_head;
|
explore_config.table.show_header = show_head;
|
||||||
explore_config.table.show_index = show_index;
|
explore_config.table.show_index = show_index;
|
||||||
|
@ -213,9 +208,6 @@ impl ExploreConfig {
|
||||||
|
|
||||||
if let Some(s) = colors.get("selected_cell") {
|
if let Some(s) = colors.get("selected_cell") {
|
||||||
ret.selected_cell = *s;
|
ret.selected_cell = *s;
|
||||||
} else {
|
|
||||||
// light blue background as default
|
|
||||||
ret.selected_cell = color(None, Some(Color::LightBlue));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(hm) = explore_cfg_hash_map.get("status").and_then(create_map) {
|
if let Some(hm) = explore_cfg_hash_map.get("status").and_then(create_map) {
|
||||||
|
|
|
@ -44,7 +44,8 @@ impl<'a> RecordView<'a> {
|
||||||
layer_stack: vec![RecordLayer::new(columns, records)],
|
layer_stack: vec![RecordLayer::new(columns, records)],
|
||||||
mode: UIMode::View,
|
mode: UIMode::View,
|
||||||
orientation: Orientation::Top,
|
orientation: Orientation::Top,
|
||||||
// this is kind of gross. can we pass in ExploreConfig in the constructor instead of setting it later?
|
// TODO: It's kind of gross how this temporarily has an incorrect/default config.
|
||||||
|
// See if we can pass correct config in through the constructor
|
||||||
cfg: ExploreConfig::default(),
|
cfg: ExploreConfig::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -303,7 +304,6 @@ impl View for RecordView<'_> {
|
||||||
|
|
||||||
// todo: move the method to Command?
|
// todo: move the method to Command?
|
||||||
fn setup(&mut self, cfg: ViewConfig<'_>) {
|
fn setup(&mut self, cfg: ViewConfig<'_>) {
|
||||||
// gross, move this to a constructor
|
|
||||||
self.cfg = cfg.explore_config.clone();
|
self.cfg = cfg.explore_config.clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user