diff options
author | Canop <cano.petrole@gmail.com> | 2021-08-03 20:49:25 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2021-08-04 13:25:29 +0200 |
commit | c68e7f3bd12ad14214e074d90c1640d8b2536801 (patch) | |
tree | 797741ea2fae240960a9aa03ce3dadb79cb29856 /src/app | |
parent | 3123abc98b2f2e8e52da3ecce96c690341e75c11 (diff) |
improve scrolling behaviors
Especially move the selection when you're at one end and you
try to scroll the blocked way. Fix #419
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/app.rs | 4 | ||||
-rw-r--r-- | src/app/panel.rs | 10 | ||||
-rw-r--r-- | src/app/panel_state.rs | 6 | ||||
-rw-r--r-- | src/app/standard_status.rs | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/app/app.rs b/src/app/app.rs index efd5045..31d4c16 100644 --- a/src/app/app.rs +++ b/src/app/app.rs @@ -617,7 +617,7 @@ impl App { con, }; self.mut_panel().refresh_input_status(app_state, &app_cmd_context); - self.display_panels(w, &skin, app_state, con)?; + self.display_panels(w, skin, app_state, con)?; } else { warn!("unexpected lack of update on do_pending_task"); return Ok(()); @@ -688,7 +688,7 @@ impl App { .map(|server_name| { let shared_root = Arc::new(Mutex::new(app_state.root.clone())); let server = crate::net::Server::new( - &server_name, + server_name, self.tx_seqs.clone(), Arc::clone(&shared_root), ); diff --git a/src/app/panel.rs b/src/app/panel.rs index 6a2f97c..f4a6d30 100644 --- a/src/app/panel.rs +++ b/src/app/panel.rs @@ -128,7 +128,7 @@ impl Panel { app_state: &AppState, con: &AppContext, ) -> Result<Command, ProgramError> { - let sel_info = self.states[self.states.len() - 1].sel_info(&app_state); + let sel_info = self.states[self.states.len() - 1].sel_info(app_state); self.input.on_event(w, event, con, sel_info, app_state, self.state().get_mode()) } @@ -195,21 +195,21 @@ impl Panel { ) -> Result<(), ProgramError> { self.mut_state().display(w, disc)?; if disc.active || !WIDE_STATUS { - self.write_status(w, &disc.panel_skin, disc.screen)?; + self.write_status(w, disc.panel_skin, disc.screen)?; } let mut input_area = self.areas.input.clone(); if disc.active { - self.write_purpose(w, &disc.panel_skin, disc.screen, &disc.con)?; + self.write_purpose(w, disc.panel_skin, disc.screen, disc.con)?; let flags = self.state().get_flags(); let input_content_len = self.input.get_content().len() as u16; let flags_len = flags_display::visible_width(&flags); if input_area.width > input_content_len + 1 + flags_len { input_area.width -= flags_len + 1; disc.screen.goto(w, input_area.left + input_area.width, input_area.top)?; - flags_display::write(w, &flags, &disc.panel_skin)?; + flags_display::write(w, &flags, disc.panel_skin)?; } } - self.input.display(w, disc.active, self.state().get_mode(), input_area, &disc.panel_skin)?; + self.input.display(w, disc.active, self.state().get_mode(), input_area, disc.panel_skin)?; Ok(()) } diff --git a/src/app/panel_state.rs b/src/app/panel_state.rs index bae620f..83a0138 100644 --- a/src/app/panel_state.rs +++ b/src/app/panel_state.rs @@ -463,7 +463,7 @@ pub trait PanelState { ) -> Result<CmdResult, ProgramError> { let sel_info = self.sel_info(app_state); if let Some(invocation) = &invocation { - if let Some(error) = verb.check_args(&sel_info, &invocation, &app_state.other_panel_path) { + if let Some(error) = verb.check_args(&sel_info, invocation, &app_state.other_panel_path) { debug!("verb.check_args prevented execution: {:?}", &error); return Ok(CmdResult::error(error)); } @@ -478,7 +478,7 @@ pub trait PanelState { &None }, ); - external_execution.to_cmd_result(w, exec_builder, &cc.app.con) + external_execution.to_cmd_result(w, exec_builder, cc.app.con) } fn execute_sequence( @@ -614,7 +614,7 @@ pub trait PanelState { InputPattern::none(), prefered_mode, self.tree_options(), - &cc.app.con, + cc.app.con, )), purpose: PanelPurpose::Preview, direction: HDir::Right, diff --git a/src/app/standard_status.rs b/src/app/standard_status.rs index 3b8f256..5a4c123 100644 --- a/src/app/standard_status.rs +++ b/src/app/standard_status.rs @@ -73,7 +73,7 @@ impl StandardStatus { state_type: PanelStateType, selection: Selection<'s>, ) -> StandardStatusBuilder<'s> { - StandardStatusBuilder::new(&self, state_type, selection) + StandardStatusBuilder::new(self, state_type, selection) } } |