fix: rename variable as stated in pull request
This commit is contained in:
parent
5799ea4e5d
commit
734636637d
3 changed files with 15 additions and 15 deletions
|
|
@ -27,7 +27,7 @@ fn route_action(
|
|||
Action::GoToLastTab => {
|
||||
session
|
||||
.senders
|
||||
.send_to_screen(ScreenInstruction::GoToLastTab)
|
||||
.send_to_screen(ScreenInstruction::ToggleTab)
|
||||
.unwrap();
|
||||
}
|
||||
Action::Write(val) => {
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ pub(crate) enum ScreenInstruction {
|
|||
ToggleActiveSyncTab,
|
||||
CloseTab,
|
||||
GoToTab(u32),
|
||||
GoToLastTab,
|
||||
ToggleTab,
|
||||
UpdateTabName(Vec<u8>),
|
||||
TerminalResize(PositionAndSize),
|
||||
ChangeMode(ModeInfo),
|
||||
|
|
@ -134,7 +134,7 @@ impl From<&ScreenInstruction> for ScreenContext {
|
|||
ScreenInstruction::MouseRelease(_) => ScreenContext::MouseRelease,
|
||||
ScreenInstruction::MouseHold(_) => ScreenContext::MouseHold,
|
||||
ScreenInstruction::Copy => ScreenContext::Copy,
|
||||
ScreenInstruction::GoToLastTab => ScreenContext::GoToLastTab,
|
||||
ScreenInstruction::ToggleTab => ScreenContext::ToggleTab,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -152,7 +152,7 @@ pub(crate) struct Screen {
|
|||
position_and_size: PositionAndSize,
|
||||
/// The index of this [`Screen`]'s active [`Tab`].
|
||||
active_tab_index: Option<usize>,
|
||||
last_active_tab_index: Option<usize>,
|
||||
previous_active_tab_index: Option<usize>,
|
||||
mode_info: ModeInfo,
|
||||
colors: Palette,
|
||||
session_state: Arc<RwLock<SessionState>>,
|
||||
|
|
@ -173,7 +173,7 @@ impl Screen {
|
|||
position_and_size: client_attributes.position_and_size,
|
||||
colors: client_attributes.palette,
|
||||
active_tab_index: None,
|
||||
last_active_tab_index: None,
|
||||
previous_active_tab_index: None,
|
||||
tabs: BTreeMap::new(),
|
||||
mode_info,
|
||||
session_state,
|
||||
|
|
@ -198,7 +198,7 @@ impl Screen {
|
|||
self.colors,
|
||||
self.session_state.clone(),
|
||||
);
|
||||
self.last_active_tab_index = self.active_tab_index;
|
||||
self.previous_active_tab_index = self.active_tab_index;
|
||||
self.active_tab_index = Some(tab_index);
|
||||
self.tabs.insert(tab_index, tab);
|
||||
self.update_tabs();
|
||||
|
|
@ -224,7 +224,7 @@ impl Screen {
|
|||
for tab in self.tabs.values_mut() {
|
||||
if tab.position == new_tab_pos {
|
||||
tab.set_force_render();
|
||||
self.last_active_tab_index = self.active_tab_index;
|
||||
self.previous_active_tab_index = self.active_tab_index;
|
||||
self.active_tab_index = Some(tab.index);
|
||||
break;
|
||||
}
|
||||
|
|
@ -244,7 +244,7 @@ impl Screen {
|
|||
for tab in self.tabs.values_mut() {
|
||||
if tab.position == new_tab_pos {
|
||||
tab.set_force_render();
|
||||
self.last_active_tab_index = self.active_tab_index;
|
||||
self.previous_active_tab_index = self.active_tab_index;
|
||||
self.active_tab_index = Some(tab.index);
|
||||
break;
|
||||
}
|
||||
|
|
@ -259,7 +259,7 @@ impl Screen {
|
|||
if let Some(t) = self.tabs.values_mut().find(|t| t.position == tab_index) {
|
||||
if t.index != active_tab_index {
|
||||
t.set_force_render();
|
||||
self.last_active_tab_index = self.active_tab_index;
|
||||
self.previous_active_tab_index = self.active_tab_index;
|
||||
self.active_tab_index = Some(t.index);
|
||||
self.update_tabs();
|
||||
self.render();
|
||||
|
|
@ -285,7 +285,7 @@ impl Screen {
|
|||
.unwrap();
|
||||
if self.tabs.is_empty() {
|
||||
self.active_tab_index = None;
|
||||
self.last_active_tab_index = None;
|
||||
self.previous_active_tab_index = None;
|
||||
if *self.session_state.read().unwrap() == SessionState::Attached {
|
||||
self.bus
|
||||
.senders
|
||||
|
|
@ -370,7 +370,7 @@ impl Screen {
|
|||
self.session_state.clone(),
|
||||
);
|
||||
tab.apply_layout(layout, new_pids, tab_index);
|
||||
self.last_active_tab_index = self.active_tab_index;
|
||||
self.previous_active_tab_index = self.active_tab_index;
|
||||
self.active_tab_index = Some(tab_index);
|
||||
self.tabs.insert(tab_index, tab);
|
||||
self.update_tabs();
|
||||
|
|
@ -429,10 +429,10 @@ impl Screen {
|
|||
}
|
||||
pub fn go_to_last_tab(&mut self) {
|
||||
let active_tab_index = self.active_tab_index.unwrap();
|
||||
if let Some(i) = self.last_active_tab_index {
|
||||
if let Some(i) = self.previous_active_tab_index {
|
||||
self.go_to_tab(i + 1);
|
||||
}
|
||||
self.last_active_tab_index = Some(active_tab_index);
|
||||
self.previous_active_tab_index = Some(active_tab_index);
|
||||
self.update_tabs();
|
||||
self.render();
|
||||
}
|
||||
|
|
@ -770,7 +770,7 @@ pub(crate) fn screen_thread_main(
|
|||
ScreenInstruction::Exit => {
|
||||
break;
|
||||
}
|
||||
ScreenInstruction::GoToLastTab => {
|
||||
ScreenInstruction::ToggleTab => {
|
||||
screen.go_to_last_tab();
|
||||
screen
|
||||
.bus
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ pub enum ScreenContext {
|
|||
MouseRelease,
|
||||
MouseHold,
|
||||
Copy,
|
||||
GoToLastTab,
|
||||
ToggleTab,
|
||||
}
|
||||
|
||||
/// Stack call representations corresponding to the different types of [`PtyInstruction`]s.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue