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