id stringlengths 20 30 | source stringclasses 1
value | chunk_index int64 0 520k | token_count int32 154 512 | content stringlengths 185 57.5k |
|---|---|---|---|---|
rust_dataset_chunk_515100 | rust_dataset.txt | 515,100 | 512 | _iter()
.chain(floating)
.map(|(id, title, _, _)| (id, title))
.collect()
}
pub fn get_selectable_tiled_panes_count(&self) -> usize {
self.get_selectable_tiled_panes().count()
}
pub fn get_selectable_floating_panes_count(&self) -> usize {
self.get_sele... |
rust_dataset_chunk_515101 | rust_dataset.txt | 515,101 | 512 | _context = || format!("failed to resize PTYs of all panes in tab {}", self.id);
self.tiled_panes
.resize_pty_all_panes()
.with_context(err_context)?;
self.floating_panes
.resize_pty_all_panes(&mut self.os_api)
.with_context(err_context)?;
for (_is_... |
rust_dataset_chunk_515102 | rust_dataset.txt | 515,102 | 512 | )?;
self.tiled_panes.resize(new_screen_size);
if self.auto_layout && !self.swap_layouts.is_floating_damaged() {
// we do this only for floating panes, because the constraint system takes care of the
// tiled panes
self.swap_layouts.set_is_floating_damaged();
... |
rust_dataset_chunk_515103 | rust_dataset.txt | 515,103 | 512 | _panes
.resize_active_pane(client_id, &mut self.os_api, &strategy)
.with_context(err_context)?;
if successfully_resized {
self.swap_layouts.set_is_floating_damaged();
self.set_force_render(); // we force render here to make sure the panes under... |
rust_dataset_chunk_515104 | rust_dataset.txt | 515,104 | 512 | screen_is_active() {
self.switch_prev_pane_fullscreen(client_id);
return;
}
self.tiled_panes.focus_previous_pane(client_id);
}
pub fn focus_last_pane(&mut self, client_id: ClientId) {
if !self.has_selectable_panes() {
return;
}
if self.... |
rust_dataset_chunk_515105 | rust_dataset.txt | 515,105 | 512 | .fullscreen_is_active() {
return Ok(self.focus_pane_left_fullscreen(client_id));
}
if self.stacked_pane_list_is_active()
&& self.move_focus_within_stack_list(
client_id,
false,
StackListOrientation::Horiz... |
rust_dataset_chunk_515106 | rust_dataset.txt | 515,106 | 512 | focus moved
pub fn move_focus_right(&mut self, client_id: ClientId) -> Result<bool> {
let err_context = || format!("failed to move focus right for client {}", client_id);
if self.floating_panes.panes_are_visible() {
self.floating_panes
.move_focus(
c... |
rust_dataset_chunk_515107 | rust_dataset.txt | 515,107 | 512 | }
if self.tiled_panes.fullscreen_is_active() {
return;
}
let search_backwards = true;
if self.floating_panes.panes_are_visible() {
self.floating_panes
.move_active_pane(search_backwards, &mut self.os_api, client_id);
} else {
... |
rust_dataset_chunk_515108 | rust_dataset.txt | 515,108 | 512 | _id);
}
}
pub fn move_pane_up(&mut self, pane_id: PaneId) {
if self.floating_panes.panes_are_visible() {
if self.floating_panes.move_pane_up(pane_id) {
self.swap_layouts.set_is_floating_damaged();
self.set_force_render();
}
} else {... |
rust_dataset_chunk_515109 | rust_dataset.txt | 515,109 | 512 | _is_active() {
return;
}
self.dissolve_stack_lists_for_classic_mutation();
self.tiled_panes.move_active_pane_left(client_id);
}
}
pub fn move_pane_left(&mut self, pane_id: PaneId) {
if self.floating_panes.panes_are_visible() {
if se... |
rust_dataset_chunk_515110 | rust_dataset.txt | 515,110 | 512 | _ids
}
pub fn get_static_and_floating_pane_ids(&self) -> Vec<PaneId> {
self.tiled_panes
.pane_ids()
.chain(self.floating_panes.pane_ids())
.copied()
.collect()
}
pub fn get_plugin_ids(&self) -> Vec<PluginId> {
self.get_static_and_floating_p... |
rust_dataset_chunk_515111 | rust_dataset.txt | 515,111 | 512 | .is_focused = false;
info.is_fullscreen = self.floating_panes.fullscreen_pane_id() == Some(pane_id);
info.is_floating = true;
info.is_suppressed = false;
return Some(info);
}
// Check suppressed panes
if let Some((_previous_id, pane)) = self.suppr... |
rust_dataset_chunk_515112 | rust_dataset.txt | 515,112 | 512 | draw it blank. Collapsing takes it
/// out of the layout's arithmetic without taking it out of the layout, so expanding puts it
/// back at the size the layout asked for.
///
/// Floating panes take no space from their neighbors, so there is nothing to give back.
pub fn bar_pane_ids(&self) -> Vec<P... |
rust_dataset_chunk_515113 | rust_dataset.txt | 515,113 | 512 | fn apply_hidden_bars(&mut self, hidden_bars: &HiddenBars) -> bool {
let hidden_bars_changed = &self.hidden_bars != hidden_bars;
self.hidden_bars = hidden_bars.clone();
let bar_pane_ids = self.bar_pane_ids();
let mut changed = false;
for pane_id in self.tiled_panes.hidden_bar_ids... |
rust_dataset_chunk_515114 | rust_dataset.txt | 515,114 | 512 | if !self.tiled_panes.set_pane_collapsed(pane_id, collapsed) {
return;
}
let size = self.size;
self.resize_whole_tab(size).non_fatal();
}
pub fn close_pane(
&mut self,
id: PaneId,
ignore_suppressed_panes: bool,
exit_status: Option<i32>,
... |
rust_dataset_chunk_515115 | rust_dataset.txt | 515,115 | 512 | },
Ok(_pane) => {},
Err(e) => {
Err::<(), _>(e)
.with_context(|| format!("failed to close pane {:?}", id))
.non_fatal();
},
};
}
let closed_pane = if self.float... |
rust_dataset_chunk_515116 | rust_dataset.txt | 515,116 | 512 | id: PaneId,
dont_swap_if_suppressed: bool,
) -> Option<Box<dyn Pane>> {
self.forget_typed_input(id);
let id_parks_a_different_pane = self.pane_parked_by(&id).is_some();
if self.pane_is_stack_list_member(&id)
&& (dont_swap_if_suppressed || !id_parks_a_different_pane)
... |
rust_dataset_chunk_515117 | rust_dataset.txt | 515,117 | 512 | .tiled_panes.fullscreen_is_active() {
self.tiled_panes.unset_fullscreen();
}
let mut closed_pane = self.tiled_panes.remove_pane(id);
self.set_force_render();
self.tiled_panes.set_force_render();
if self.auto_layout && !self.swap_layouts.is_tile... |
rust_dataset_chunk_515118 | rust_dataset.txt | 515,118 | 512 | 1.hold(exit_status, is_first_run, run_command);
}
}
pub fn replace_pane_with_suppressed_pane(
&mut self,
pane_id: PaneId,
) -> Result<Option<Box<dyn Pane>>> {
self.suppressed_panes
.remove(&pane_id)
.with_context(|| {
format!(
... |
rust_dataset_chunk_515119 | rust_dataset.txt | 515,119 | 512 | Ok(replaced_pane)
})
.with_context(|| {
format!(
"failed to replace active pane with suppressed pane {:?}",
pane_id
)
})
}
pub fn close_focused_pane(
&mut self,
client_id: ... |
rust_dataset_chunk_515120 | rust_dataset.txt | 515,120 | 512 |
.write_to_file(dump, file)
.with_context(err_context)?;
}
Ok(())
}
pub fn dump_with_ansi_active_terminal_screen(
&mut self,
file: Option<String>,
client_id: ClientId,
full: bool,
) -> Result<()> {
let err_context =
... |
rust_dataset_chunk_515121 | rust_dataset.txt | 515,121 | 512 | : PaneId, full: bool) -> Option<String> {
if let Some(pane) = self.get_pane_with_id(pane_id) {
Some(pane.dump_screen(full, None))
} else {
None
}
}
pub fn get_dump_with_ansi_terminal_screen(
&mut self,
pane_id: PaneId,
full: bool,
) -> ... |
rust_dataset_chunk_515122 | rust_dataset.txt | 515,122 | 512 | pane_id: PaneId,
completion_tx: Option<NotificationEnd>,
) -> Result<()> {
if let PaneId::Terminal(_terminal_pane_id) = pane_id {
self.make_hidden_stack_list_member_visible(pane_id);
let file = private_scrollback_dump_path();
self.dump_terminal_screen(Some... |
rust_dataset_chunk_515123 | rust_dataset.txt | 515,123 | 512 | }
}
pub fn scroll_active_terminal_to_next_prompt(&mut self, client_id: ClientId) {
if let Some(active_pane) = self.get_active_pane_or_floating_pane_mut(client_id) {
active_pane.scroll_to_next_prompt(client_id);
}
}
pub fn select_command_at_scroll_position(&mut self,... |
rust_dataset_chunk_515124 | rust_dataset.txt | 515,124 | 512 | if is_alt {
self.write_to_pane_id(&None, b"\x1b[A".to_vec(), false, pane_id, None, None)
.with_context(err_context)?;
} else if let Some(pane) = self.get_pane_with_id_mut(pane_id) {
pane.scroll_up(1, fictitious_client_id);
}
Ok(())
}
pub fn scrol... |
rust_dataset_chunk_515125 | rust_dataset.txt | 515,125 | 512 | .with_context(err_context)?;
}
}
Ok(())
}
pub fn scroll_active_terminal_up_page(&mut self, client_id: ClientId) {
if let Some(active_pane) = self.get_active_pane_or_floating_pane_mut(client_id) {
// prevent overflow when row == 0
l... |
rust_dataset_chunk_515126 | rust_dataset.txt | 515,126 | 512 | );
if !terminal_pane.is_scrolled() {
if let PaneId::Terminal(raw_fd) = terminal_pane.pid() {
self.process_pending_vte_events(raw_fd).non_fatal()
}
}
}
}
pub fn scroll_active_terminal_up_half_page(&mut self, client_id: ClientId)... |
rust_dataset_chunk_515127 | rust_dataset.txt | 515,127 | 512 | Id::Terminal(raw_fd) = terminal_pane.pid() {
self.process_pending_vte_events(raw_fd).non_fatal();
}
}
}
}
pub fn scroll_active_terminal_to_top(&mut self, client_id: ClientId) -> Result<()> {
if let Some(active_pane) = self.get_active_pane_or_float... |
rust_dataset_chunk_515128 | rust_dataset.txt | 515,128 | 512 | )
}
fn get_pane_id_at(
&mut self,
point: &Position,
search_selectable: bool,
) -> Result<Option<PaneId>> {
let err_context = || format!("failed to get id of pane at position {point:?}");
if self.tiled_panes.fullscreen_is_active()
&& (self.tiled_panes.ful... |
rust_dataset_chunk_515129 | rust_dataset.txt | 515,129 | 512 | else {
p.current_geom()
};
geom_to_compare_against.contains(point)
};
let found_pane_id = if search_selectable {
self.get_selectable_tiled_panes()
.filter(|(id, _)| !self.tiled_panes.pane_is_collapsed(id))
.fin... |
rust_dataset_chunk_515130 | rust_dataset.txt | 515,130 | 512 | MouseHandler::get_pane_at(self, &event.position, false) {
let pane_id = pane.pid();
if let PaneId::Terminal(_) = pane_id {
self.local_input.insert(pane_id);
}
}
}
pub fn copy_selection(&self, client_id: ClientId) -> Result<()> {
let selected_... |
rust_dataset_chunk_515131 | rust_dataset.txt | 515,131 | 512 | ::<(), _>(err).with_context(err_context).non_fatal();
Event::SystemClipboardFailure
},
};
self.senders
.send_to_plugin(PluginInstruction::Update(vec![(
None,
None,
clipboard_event,
)]))
.conte... |
rust_dataset_chunk_515132 | rust_dataset.txt | 515,132 | 512 | }
pub fn rename_active_pane(&mut self, buf: Vec<u8>, client_id: ClientId) -> Result<()> {
if let Some(active_pane) = self.get_active_pane_or_floating_pane_mut(client_id) {
active_pane.rename(buf);
}
Ok(())
}
pub fn undo_active_rename_pane(&mut self, client_id: ClientId... |
rust_dataset_chunk_515133 | rust_dataset.txt | 515,133 | 512 | matches!(s, "\0" | "\u{8}" | "\u{7f}") || !s.chars().any(|c| c.is_control());
if is_updatable {
active_pane.update_search_term(s);
}
}
}
Ok(())
}
pub fn search_down(&mut self, client_id: ClientId) {
if let Some(active_pane... |
rust_dataset_chunk_515134 | rust_dataset.txt | 515,134 | 512 | map(|s_p| &mut s_p.1)
})
{
pane.add_red_pane_frame_color_override(error_text);
}
}
pub fn add_highlight_pane_frame_color_override(
&mut self,
pane_id: PaneId,
error_text: Option<String>,
client_id: Option<ClientId>,
) {
if let S... |
rust_dataset_chunk_515135 | rust_dataset.txt | 515,135 | 512 | u32) {
if let Some(pane) = self.get_pane_with_id_mut(pane_id) {
pane.clear_plugin_highlights(plugin_id);
}
}
pub fn update_plugin_loading_stage(&mut self, pid: u32, loading_indication: LoadingIndication) {
if let Some(plugin_pane) = self
.tiled_panes
... |
rust_dataset_chunk_515136 | rust_dataset.txt | 515,136 | 512 | _pane.start_loading_indication_for_client(client_id, loading_indication)
},
None => plugin_pane.start_loading_indication(loading_indication),
}
}
}
pub fn progress_plugin_loading_offset(&mut self, pid: u32) {
if let Some(plugin_pane) = self
... |
rust_dataset_chunk_515137 | rust_dataset.txt | 515,137 | 512 | .rendered_pane_ids());
}
let mut plugin_ids: HashSet<PluginId> = pane_ids
.into_iter()
.filter_map(|pane_id| match pane_id {
PaneId::Plugin(plugin_id) => Some(plugin_id),
PaneId::Terminal(_) => None,
})
.collect();
f... |
rust_dataset_chunk_515138 | rust_dataset.txt | 515,138 | 512 | _plugin_or_alias: &RunPluginOrAlias) -> Option<PaneId> {
self.tiled_panes
.get_plugin_pane_id(run_plugin_or_alias)
.or_else(|| self.floating_panes.get_plugin_pane_id(run_plugin_or_alias))
.or_else(|| {
self.suppressed_panes
.iter()
... |
rust_dataset_chunk_515139 | rust_dataset.txt | 515,139 | 512 | )
} else {
self.tiled_panes.replace_active_pane(pane, client_id)
};
match replaced_pane {
Ok(replaced_pane) => {
let is_scrollback_edito... |
rust_dataset_chunk_515140 | rust_dataset.txt | 515,140 | 512 | own (eg. a plugin using the
// show_self() method)
if let Some(pane) = self.extract_pane(pane_id, true) {
self.insert_suppressed_pane(pane_id, (false, pane));
}
}
fn take_suppressed_pane_by_pid(&mut self, pane_id: PaneId) -> Option<Box<dyn Pane>> {
let stored_under_o... |
rust_dataset_chunk_515141 | rust_dataset.txt | 515,141 | 512 | .extract_if(|_key, (_, pane)| pane.pid() == pane_id)
.next()
.map(|(_key, (_, pane))| pane)
{
Some(pane) => {
if should_float_if_hidden {
self.add_floating_pane(pane, pane_id, None, true, None)
.non_fatal();
... |
rust_dataset_chunk_515142 | rust_dataset.txt | 515,142 | 512 | not to drop
// (close) any existing panes in the map. We repeat the action of remapping existing panes
// under their own keys until all keys either reference the suppressing_pane_id (only one
// can do this) or themselves
let mut key_to_insert = suppressing_pane_id;
let mut pan... |
rust_dataset_chunk_515143 | rust_dataset.txt | 515,143 | 512 | }
pub fn add_floating_pane(
&mut self,
pane: Box<dyn Pane>,
pane_id: PaneId,
floating_pane_coordinates: Option<FloatingPaneCoordinates>,
should_focus_new_pane: bool,
client_id: Option<ClientId>,
) -> Result<()> {
if let Some(pane) = self.try_add_floati... |
rust_dataset_chunk_515144 | rust_dataset.txt | 515,144 | 512 | floating_pane_coordinates
.and_then(|c| c.borderless)
.unwrap_or(false);
if is_borderless {
pane.set_content_offset(Offset::frame(0));
pane.set_borderless(true);
} else {
pane.set_content_offset(Offset::frame(1)); /... |
rust_dataset_chunk_515145 | rust_dataset.txt | 515,145 | 512 | Ok(())
}
fn try_add_tiled_pane(
&mut self,
mut pane: Box<dyn Pane>,
pane_id: PaneId,
without_relayout: bool,
client_id: Option<ClientId>,
) -> Result<Option<Box<dyn Pane>>> {
let previous_fullscreen = self
.tiled_panes
.fullscreen_pane... |
rust_dataset_chunk_515146 | rust_dataset.txt | 515,146 | 512 | (pane));
}
if should_auto_layout {
// only do this if we're already in this layout, otherwise it might be
// confusing and not what the user intends
self.swap_layouts.set_is_tiled_damaged(); // we do this so that we won't skip to the
... |
rust_dataset_chunk_515147 | rust_dataset.txt | 515,147 | 512 | ::error!("No room for pane {:?} in this tab, suppressing it", pane_id);
self.insert_suppressed_pane(pane_id, (false, pane));
if !self.floating_panes.has_panes() && self.floating_panes.panes_are_shown() {
self.hide_floating_panes();
}
}
Ok(())
}
... |
rust_dataset_chunk_515148 | rust_dataset.txt | 515,148 | 512 | PaneId,
should_focus: bool,
) -> Result<()> {
if self.tiled_panes.fullscreen_is_active() {
self.tiled_panes.unset_fullscreen();
}
self.dissolve_stack_lists_for_classic_mutation();
if let Some(pane) =
self.tiled_panes
.add_pane_to_stack... |
rust_dataset_chunk_515149 | rust_dataset.txt | 515,149 | 512 | `.
self.sync_stacked_pane_list_mode();
if should_focus {
self.tiled_panes.focus_pane(pane_id, client_id);
}
self.swap_layouts.set_is_tiled_damaged();
Ok(())
}
pub fn request_plugin_permissions(&mut self, pid: u32, permissions: Option<PluginPermission>) {
... |
rust_dataset_chunk_515150 | rust_dataset.txt | 515,150 | 512 | (&pane_id)
.or_else(|| self.tiled_panes.get_pane_mut(pane_id))
.or_else(|| self.suppressed_panes.get_mut(&pane_id).map(|p| &mut p.1))
{
Some(pane_to_rerun) => {
if let Some(command_to_rerun) = pane_to_rerun.rerun() {
self.pids_waiting_resiz... |
rust_dataset_chunk_515151 | rust_dataset.txt | 515,151 | 512 | } else {
pane_ids_to_error.push(PaneId::Plugin(*id));
};
}
self.senders
.send_to_background_jobs(BackgroundJob::DisplayPaneError(
... |
rust_dataset_chunk_515152 | rust_dataset.txt | 515,152 | 512 | _arrow_fonts(&mut self, should_support_arrow_fonts: bool) {
self.arrow_fonts = should_support_arrow_fonts;
self.floating_panes
.update_pane_arrow_fonts(should_support_arrow_fonts);
self.tiled_panes
.update_pane_arrow_fonts(should_support_arrow_fonts);
for (_, pane... |
rust_dataset_chunk_515153 | rust_dataset.txt | 515,153 | 512 | self, mouse_scroll_resize: bool) {
self.mouse_scroll_resize = mouse_scroll_resize;
}
pub fn update_mouse_hover_effects(&mut self, mouse_hover_effects: bool) {
self.mouse_hover_effects = mouse_hover_effects;
}
pub fn update_mouse_hover_tips(&mut self, mouse_hover_tips: bool) {
se... |
rust_dataset_chunk_515154 | rust_dataset.txt | 515,154 | 512 | _plugin_pane_for_full_render(&mut self, plugin_id: u32) {
let pane_id = PaneId::Plugin(plugin_id);
let pane = match self.get_pane_with_id_mut(pane_id) {
Some(pane) => Some(pane),
None => self.popup_pane_mut(plugin_id),
};
if let Some(pane) = pane {
pan... |
rust_dataset_chunk_515155 | rust_dataset.txt | 515,155 | 512 | : bool,
word_separators: String,
) {
self.osc133_command_selection = osc133_command_selection;
self.word_separators = word_separators;
}
pub fn clear_mouse_hover_state(&mut self) {
self.mouse_hover_pane_id.clear();
self.plugin_hover_pane_id.clear();
self.mouse... |
rust_dataset_chunk_515156 | rust_dataset.txt | 515,156 | 512 | self
.tiled_panes
.room_left_in_stack_of_pane_id(&root_pane_id)
.unwrap_or(0);
stack_size <= room_left_in_stack
} else {
self.get_pane_with_id(root_pane_id)
.map(|p| p.position_and_size().rows.as_usize() >= stack_size + MIN... |
rust_dataset_chunk_515157 | rust_dataset.txt | 515,157 | 512 | (pane_id, pane);
if self.tiled_panes.pane_id_is_focused(&pane_id) {
focused_pane_id_in_stack = Some(pane_id);
}
}
// if we had a focused pane in the stack, we expand it
if let Some(focused_pane_id_in_stack) = focused_pane_id_in_stac... |
rust_dataset_chunk_515158 | rust_dataset.txt | 515,158 | 512 | pane) = self.floating_panes.get_pane_mut(*pane_id) {
let is_borderless = pane.borderless();
if is_borderless {
pane.set_content_offset(Offset::frame(1));
} else {
pane.set_content_offset(Offset::default());
}
pane.set_borderless... |
rust_dataset_chunk_515159 | rust_dataset.txt | 515,159 | 512 | pressed_panes.get_mut(pane_id) {
if borderless {
pane.1.set_content_offset(Offset::default());
} else {
pane.1.set_content_offset(Offset::frame(1));
}
pane.1.set_borderless(borderless);
return Ok(());
}
log::err... |
rust_dataset_chunk_515160 | rust_dataset.txt | 515,160 | 512 | ,
self.arrow_fonts,
self.styled_underlines,
self.osc8_hyperlinks,
self.explicitly_disable_kitty_keyboard_protocol,
None,
)
.with_grapheme_clusters(self.grapheme_clusters);
if let Some(supported) = self.kitty_host_support {
n... |
rust_dataset_chunk_515161 | rust_dataset.txt | 515,161 | 512 | _pane_with_id_mut(pane_id) {
pane.clear_scroll();
if let Some(size) = pane.get_line_number() {
pane.scroll_up(size, fictitious_client_id);
}
}
Ok(())
}
pub fn scroll_to_bottom_by_pane_id(&mut self, pane_id: PaneId) -> Result<()> {
if le... |
rust_dataset_chunk_515162 | rust_dataset.txt | 515,162 | 512 | _sub(1)) / 2;
pane.scroll_down(scroll_rows, fictitious_client_id);
if !pane.is_scrolled() {
if let PaneId::Terminal(raw_fd) = pane.pid() {
self.process_pending_vte_events(raw_fd)?;
}
}
}
Ok(())
}
pub fn resiz... |
rust_dataset_chunk_515163 | rust_dataset.txt | 515,163 | 512 | {
self.tiled_panes.move_pane_down(pane_id);
}
},
None => {
let search_backwards = false;
if self.floating_panes.panes_contain(&pane_id) {
self.floating_panes.move_pane(search_backwards, pane_id);
... |
rust_dataset_chunk_515164 | rust_dataset.txt | 515,164 | 512 | _pane_with_id_mut(pane_id) {
pane.load_pane_name();
}
}
pub fn toggle_pane_pinned_by_pane_id(&mut self, pane_id: PaneId) {
if let Some(pane) = self.get_pane_with_id_mut(pane_id) {
pane.toggle_pinned();
self.set_force_render();
}
}
}
fn private_scr... |
rust_dataset_chunk_515165 | rust_dataset.txt | 515,165 | 512 | !(pane.pid(), PaneId::Plugin(_)) && !pane.supports_mouse_selection() {
flags |= PANE_PLUGIN_UI;
}
if focused {
flags |= PANE_FOCUSED;
}
if pane.selectable() {
flags |= PANE_SELECTABLE;
}
if pane.terminal_emulator_wants_mouse() {
flags |= PANE_WANTS_MOUSE;
}
... |
rust_dataset_chunk_515166 | rust_dataset.txt | 515,166 | 512 | _fg, default_bg) = pane.get_pane_default_colors();
pane_info.default_fg = default_fg;
pane_info.default_bg = default_bg;
if pane.is_nested_guest() {
pane_info.nested_session_name = pane.guest_session_name();
}
match pane_id {
PaneId::Terminal(terminal_id) => {
pane_info.... |
rust_dataset_chunk_515167 | rust_dataset.txt | 515,167 | 512 | panes::terminal_character::{AnsiCode, RcCharacterStyles, TerminalCharacter};
use crate::panes::PaneId;
use crate::plugins::PluginInstruction;
use crate::screen::{GuestModalOutcome, ScreenInstruction};
use crate::ClientId;
use super::{Pane, Tab, MIN_TERMINAL_HEIGHT, MIN_TERMINAL_WIDTH};
pub(crate) const CLASSIC_WHEEL_... |
rust_dataset_chunk_515168 | rust_dataset.txt | 515,168 | 512 | <PaneId>,
pub ungroup: bool,
pub open_context_menu: Option<ContextMenuRequest>,
pub run_actions: Option<Vec<Action>>,
pub pane_resized: bool,
}
const CLICK_TIME_THRESHOLD_MS: u128 = 400;
pub const PANE_DRAWING_Z_INDEX: usize = usize::MAX;
#[derive(Debug, Clone, PartialEq)]
pub struct PaneDrawing {
... |
rust_dataset_chunk_515169 | rust_dataset.txt | 515,169 | 512 | _current_pane: false,
no_focus: false,
tab_id: None,
},
}
}
}
pub fn pane_drawing_outline(area: &Viewport, color: PaletteColor) -> Vec<CharacterChunk> {
if area.cols < 2 || area.rows < 2 {
return vec![];
}
let mut styles = RcCharacterStyles::r... |
rust_dataset_chunk_515170 | rust_dataset.txt | 515,170 | 512 | _changed_and_leave_clipboard_message() -> Self {
MouseEffect {
state_changed: true,
leave_clipboard_message: true,
..Default::default()
}
}
pub fn group_toggle(pane_id: PaneId) -> Self {
MouseEffect {
state_changed: true,
group_... |
rust_dataset_chunk_515171 | rust_dataset.txt | 515,171 | 512 | cols: usize,
app_first: bool,
},
ScrollRight {
pane_id: PaneId,
cols: usize,
app_first: bool,
},
PassWheelToApp {
pane_id: PaneId,
button: MouseButton,
},
ToggleFullscreen {
pane_id: PaneId,
},
RunActions {
pane_id: PaneId,... |
rust_dataset_chunk_515172 | rust_dataset.txt | 515,172 | 512 | loating: bool,
terminal_wants_mouse: bool,
is_unselectable_plugin: bool,
}
#[derive(Debug, Clone, PartialEq)]
struct MouseEventContext {
pane_id_at_position: Option<PaneId>,
active_pane_id: Option<PaneId>,
floating_visible: bool,
pane_being_resized: bool,
selecting_with_mouse: bool,
pan... |
rust_dataset_chunk_515173 | rust_dataset.txt | 515,173 | 512 | : resize_y,
direction: Some(Up),
invert_on_boundaries: false,
});
let resize_x = if delta_x < 0 { Increase } else { Decrease };
strategies.push(ResizeStrategy {
resize: resize_x,
direction: Some(Left),
in... |
rust_dataset_chunk_515174 | rust_dataset.txt | 515,174 | 512 | now.saturating_duration_since(previous.time).as_millis()
<= CLICK_TIME_THRESHOLD_MS
&& previous.count < 3 =>
{
previous.count + 1
},
_ => 1,
}
}
pub struct MouseHandler;
impl MouseHandler {
pub(crate) fn handle_mouse_event(
tab: ... |
rust_dataset_chunk_515175 | rust_dataset.txt | 515,175 | 512 | _id);
let double_clicked_plugin = Self::double_clicked_plugin(event, &action, &context);
let effect = Self::execute_mouse_action(tab, action, event, client_id)?;
if let Some(pane_id) = double_clicked_plugin {
if let Some(pane) = tab.get_pane_with_id_mut(pane_id) {
let... |
rust_dataset_chunk_515176 | rust_dataset.txt | 515,176 | 512 | ::GroupToggle(_) => Some(MousePressOwner::Group),
MouseAction::StartSelection { .. }
| MouseAction::StartResize { .. }
| MouseAction::StartMovingFloatingPane { .. }
| MouseAction::FocusPane { .. }
| MouseAction::ShowFloatingPanesAndFocus { ... |
rust_dataset_chunk_515177 | rust_dataset.txt | 515,177 | 512 | {
Some(pane_id) => pane_id,
None => return Ok(None),
};
let is_left_press = event.event_type == MouseEventType::Press && event.left;
let is_left_release = event.event_type == MouseEventType::Release && event.left;
if is_left_press {
if tab.get_active_... |
rust_dataset_chunk_515178 | rust_dataset.txt | 515,178 | 512 | : &Tab,
pane_id: PaneId,
event: &MouseEvent,
client_id: ClientId,
) -> Option<usize> {
let pane = tab.get_pane_with_id(pane_id)?;
if pane.position_is_on_frame(&event.position) {
return None;
}
let relative_position = pane.relative_position(&event.p... |
rust_dataset_chunk_515179 | rust_dataset.txt | 515,179 | 512 | ing_resized_with_mouse.is_some(),
selecting_with_mouse: tab.selecting_with_mouse_in_pane.is_some(),
pane_being_moved: tab.floating_panes.pane_is_being_moved_with_mouse(),
drawing_pane: tab.pane_drawings.contains_key(&client_id),
clicked_pane,
advanced_mouse_ac... |
rust_dataset_chunk_515180 | rust_dataset.txt | 515,180 | 512 | is_floating,
terminal_wants_mouse,
is_unselectable_plugin,
})
}
fn corner_edge_directions(edge: PaneEdge) -> Option<(Direction, Direction)> {
match edge {
PaneEdge::TopLeft => Some((Direction::Up, Direction::Left)),
PaneEdge::TopRight ... |
rust_dataset_chunk_515181 | rust_dataset.txt | 515,181 | 512 | , 1),
(-1, -1),
];
for (line_offset, column_offset) in offsets {
let line = position.line() + line_offset;
let column = position.column() as isize + column_offset;
if line < 0 || column < 0 {
continue;
}
let neighbor... |
rust_dataset_chunk_515182 | rust_dataset.txt | 515,182 | 512 | else {
tab.tiled_panes
.get_pane(pane_id)
.map(|p| p.position_and_size())
.with_context(err_context)?
};
tab.pane_being_resized_with_mouse = Some(PaneResizeState {
pane_id,
edge,
start_position: position,
... |
rust_dataset_chunk_515183 | rust_dataset.txt | 515,183 | 512 | as f64, delta_y.abs() as f64),
)
};
if resize_result.is_err() {
tab.pane_being_resized_with_mouse = None;
}
resize_result.with_context(err_context)?;
if let Some(resize_state) = tab.pane_being_resized_with_mouse.as_mut() {
resize_state.start_... |
rust_dataset_chunk_515184 | rust_dataset.txt | 515,184 | 512 | <()> {
let err_context = || format!("failed to resize tiled pane {pane_id:?}");
let viewport = tab.viewport.borrow();
let viewport_cols = viewport.cols;
let viewport_rows = viewport.rows;
let change_by_percent = (
if viewport_cols > 0 {
(change_by.0 ... |
rust_dataset_chunk_515185 | rust_dataset.txt | 515,185 | 512 | tab
.senders
.send_to_plugin(PluginInstruction::HighlightClicked {
plugin_id: hit_plugin_id,
client_id,
pane_id,
pattern,
... |
rust_dataset_chunk_515186 | rust_dataset.txt | 515,186 | 512 | ifiers(modifiers);
let mut leave_clipboard_message = false;
pane.set_selection_options(osc133_command_selection, &word_separators);
pane.start_selection(&relative_position, client_id);
if pane.get_selected_text(client_id).is_some() {
l... |
rust_dataset_chunk_515187 | rust_dataset.txt | 515,187 | 512 | ),
MouseAction::ScrollRight {
pane_id: _,
cols,
app_first,
} => Self::handle_scrollwheel_right(tab, &event.position, cols, app_first, client_id)
.with_context(err_context),
MouseAction::PassWheelToApp { pane_id, button }... |
rust_dataset_chunk_515188 | rust_dataset.txt | 515,188 | 512 | ,
position,
on_stack_titles,
} => Ok(MouseEffect::open_context_menu(ContextMenuRequest {
kind,
pane_id,
is_floating,
position,
on_stack_titles,
})),
MouseAction::ForwardRig... |
rust_dataset_chunk_515189 | rust_dataset.txt | 515,189 | 512 | _changed,
..Default::default()
})
}
fn execute_stop_drawing_pane(
tab: &mut Tab,
position: Position,
client_id: ClientId,
) -> Result<MouseEffect> {
let Some(mut drawing) = tab.pane_drawings.remove(&client_id) else {
return Ok(MouseEffect::def... |
rust_dataset_chunk_515190 | rust_dataset.txt | 515,190 | 512 | }
return Ok(MouseEffect::default());
}
let relative_position = pane.relative_position(&point);
let report = match button {
MouseButton::ScrollUp => pane.mouse_scroll_up(&relative_position),
MouseButton::ScrollDown => pane.mouse_scroll_down(&relative_position)... |
rust_dataset_chunk_515191 | rust_dataset.txt | 515,191 | 512 | selectable_plugin = Self::unselectable_pane_at_position(tab, &position)
.map(|pane| pane.pid())
.filter(|pane_id| matches!(pane_id, PaneId::Plugin(_)));
clear_hover_for_client_keeping_plugin(tab, client_id, clicked_unselectable_plugin);
let active_pane_id_before = tab
... |
rust_dataset_chunk_515192 | rust_dataset.txt | 515,192 | 512 | (|| anyhow!("Failed to find active pane"))?;
if active_pane_id_before != active_pane_id_after {
Ok(MouseEffect::state_changed())
} else {
Ok(MouseEffect::default())
}
}
fn execute_focus_pane_and_click_through(
tab: &mut Tab,
position: Position,
... |
rust_dataset_chunk_515193 | rust_dataset.txt | 515,193 | 512 | }
}
} else {
if let Some(pane) = tab.get_pane_with_id_mut(active_pane_id) {
let relative_position = pane.relative_position(&position);
pane.set_selection_options(osc133_command_selection, &word_separators);
pane.start_select... |
rust_dataset_chunk_515194 | rust_dataset.txt | 515,194 | 512 | able = false;
if tab
.floating_panes
.move_pane_with_mouse_from_anywhere(position, search_selectable)
{
tab.swap_layouts.set_is_floating_damaged();
tab.set_force_render();
Ok(MouseEffect::state_changed())
} else {
Ok(MouseEf... |
rust_dataset_chunk_515195 | rust_dataset.txt | 515,195 | 512 | anes.panes_are_visible();
let is_floating = tab.floating_panes.get_pane(pane_id).is_some();
if floating_visible && !is_floating {
return Self::execute_update_hover(tab, Some(pane_id), Some(position), client_id);
}
let is_stacked_one_liner = tab
.get_pane_with_id(... |
rust_dataset_chunk_515196 | rust_dataset.txt | 515,196 | 512 | _id {
if let Some(previous_pid) = previous_plugin_hover_pane_id {
if let Some(pane) = tab.get_pane_with_id(previous_pid) {
let _ = pane.mouse_event(
&MouseEvent::new_buttonless_motion(Position::new(0, u16::MAX)),
... |
rust_dataset_chunk_515197 | rust_dataset.txt | 515,197 | 512 | get_active_pane_id(client_id)
.ok_or_else(|| anyhow!("Failed to find active pane"))?;
if pane_id == active_pane_id {
let pane = tab
.get_pane_with_id(pane_id)
.ok_or_else(|| anyhow!("Failed to find pane {pane_id:?}"))?;
let relative_position = ... |
rust_dataset_chunk_515198 | rust_dataset.txt | 515,198 | 512 | _type {
MouseEventType::Motion => MouseAction::ContinueDrawingPane {
position: event.position,
},
MouseEventType::Release => MouseAction::StopDrawingPane {
position: event.position,
},
_ => MouseActio... |
rust_dataset_chunk_515199 | rust_dataset.txt | 515,199 | 512 | pane_id: details.pane_id,
});
}
}
}
let on_frame = ctx
.clicked_pane
.as_ref()
.map(|details| details.on_frame)
.unwrap_or(false);
let binding = ctx
.mousebinds
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.