summaryrefslogtreecommitdiffstats
path: root/src/process/help.rs
diff options
context:
space:
mode:
authorTim Oram <dev@mitmaro.ca>2020-10-29 11:53:55 -0230
committerTim Oram <dev@mitmaro.ca>2020-10-29 21:23:19 -0230
commit337daa271780f95b4b19e4e9399cf59d236eb5df (patch)
tree918212621c5b9bc02f5978135490e622178b5410 /src/process/help.rs
parent4cd7109b36d200b252c36dd29b23eb5c26a03989 (diff)
Move git interactive to todo file module
The GitInteractive stuct is one of the oldest structs in the project and was initially used as a catch-all for any functionality that was shared across the application. Overtime the functionality of this file has been moved into the various modules of the project. At this point, the only thing the struct handles is the direct interactions with the rebase todo file and it's lines. This finally moves the global stuct into a module.
Diffstat (limited to 'src/process/help.rs')
-rw-r--r--src/process/help.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/process/help.rs b/src/process/help.rs
index f909441..55bf0e1 100644
--- a/src/process/help.rs
+++ b/src/process/help.rs
@@ -1,11 +1,11 @@
use crate::display::display_color::DisplayColor;
-use crate::git_interactive::GitInteractive;
use crate::input::input_handler::{InputHandler, InputMode};
use crate::input::Input;
use crate::process::process_module::ProcessModule;
use crate::process::process_result::ProcessResult;
use crate::process::state::State;
use crate::process::util::handle_view_data_scroll;
+use crate::todo_file::TodoFile;
use crate::view::line_segment::LineSegment;
use crate::view::view_data::ViewData;
use crate::view::view_line::ViewLine;
@@ -30,7 +30,7 @@ pub struct Help {
}
impl ProcessModule for Help {
- fn activate(&mut self, _: &GitInteractive, return_state: State) -> ProcessResult {
+ fn activate(&mut self, _: &TodoFile, return_state: State) -> ProcessResult {
if self.return_state.is_none() {
self.return_state = Some(return_state);
}
@@ -41,7 +41,7 @@ impl ProcessModule for Help {
self.return_state = None;
}
- fn build_view_data(&mut self, view: &View<'_>, _: &GitInteractive) -> &ViewData {
+ fn build_view_data(&mut self, view: &View<'_>, _: &TodoFile) -> &ViewData {
let (view_width, view_height) = view.get_view_size();
let view_data = self.view_data.as_mut().unwrap_or(&mut self.no_help_view_data);
view_data.set_view_size(view_width, view_height);
@@ -49,13 +49,7 @@ impl ProcessModule for Help {
view_data
}
- fn handle_input(
- &mut self,
- input_handler: &InputHandler<'_>,
- _: &mut GitInteractive,
- _: &View<'_>,
- ) -> ProcessResult
- {
+ fn handle_input(&mut self, input_handler: &InputHandler<'_>, _: &mut TodoFile, _: &View<'_>) -> ProcessResult {
let input = input_handler.get_input(InputMode::Default);
let mut result = ProcessResult::new().input(input);
let mut view_data = self.view_data.as_mut().unwrap_or(&mut self.no_help_view_data);