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_515200
rust_dataset.txt
515,200
512
_id_at_position) { (true, MouseEventType::Motion, Some(pane_id)) => MouseAction::GroupAdd(pane_id), _ => MouseAction::NoAction, } }, Some(MousePressOwner::Swallow) => MouseAction::NoAction, None => { if event.alt...
rust_dataset_chunk_515201
rust_dataset.txt
515,201
512
_active(details.pane_id) => { Self::pass_to_app_action(button, event, ctx) }, _ => Self::focus_action(event, ctx), } } }, MouseBehaviour::Select => match details { Some...
rust_dataset_chunk_515202
rust_dataset.txt
515,202
512
NoAction, }, MouseBehaviour::GroupToggle => match ctx.pane_id_at_position { Some(pane_id) => MouseAction::GroupToggle(pane_id), None => MouseAction::NoAction, }, MouseBehaviour::Ungroup => MouseAction::Ungroup, MouseBehaviour::C...
rust_dataset_chunk_515203
rust_dataset.txt
515,203
512
::NoAction, } }, MouseBehaviour::ResizeScroll(direction) => { if !ctx.mouse_scroll_resize { return MouseAction::NoAction; } match (direction, ctx.pane_id_at_position) { (ResizeScrollDirection:...
rust_dataset_chunk_515204
rust_dataset.txt
515,204
512
Action { let Some(details) = &ctx.clicked_pane else { return MouseAction::NoAction; }; let is_active_pane = Some(details.pane_id) == ctx.active_pane_id; let is_pinned_pane = ctx .pinned_selectable .map(|id| id == details.pane_id) .unwrap_o...
rust_dataset_chunk_515205
rust_dataset.txt
515,205
512
PassWheelToApp { pane_id, button }; } return MouseAction::NoAction; } let Some(details) = &ctx.clicked_pane else { return MouseAction::NoAction; }; if details.is_unselectable_plugin { return match button { MouseButton::Left ...
rust_dataset_chunk_515206
rust_dataset.txt
515,206
512
, pane_id: details.pane_id, is_floating: details.is_floating, position: event.position, on_stack_titles: details.on_stack_titles, } } fn unselectable_pane_at_position<'a>( tab: &'a mut Tab, point: &Position, ) -> Option<&'a mut Box<dyn...
rust_dataset_chunk_515207
rust_dataset.txt
515,207
512
Effect> { Self::scroll_wheel_up(tab, point, lines, app_first, 1, client_id) } fn scroll_wheel_up( tab: &mut Tab, point: &Position, lines: usize, app_first: bool, reports: usize, client_id: ClientId, ) -> Result<MouseEffect> { let err_context =...
rust_dataset_chunk_515208
rust_dataset.txt
515,208
512
_report = if app_first { pane.mouse_scroll_down(&relative_position) } else { None }; if let Some(mouse_event) = app_report { for _ in 0..reports { tab.write_to_terminal_at(mouse_event.clone().into_bytes(), point, cli...
rust_dataset_chunk_515209
rust_dataset.txt
515,209
512
app_first: bool, client_id: ClientId, ) -> Result<MouseEffect> { let err_context = || { format!( "failed to handle scrollwheel left at position {point:?} for client {client_id}" ) }; if let Some(pane) = Self::get_pane_at(tab, point, fa...
rust_dataset_chunk_515210
rust_dataset.txt
515,210
512
_context = || format!("failed to handle resize scroll up for pane {pane_id:?}"); let is_floating = tab.floating_panes.panes_contain(&pane_id); let strategy = ResizeStrategy { resize: Resize::Increase, direction: None, invert_on_boundaries: false, }; ...
rust_dataset_chunk_515211
rust_dataset.txt
515,211
512
::pane_resized()) } pub(super) fn get_pane_at<'a>( tab: &'a mut Tab, point: &Position, search_selectable: bool, ) -> Result<Option<&'a mut Box<dyn Pane>>> { let err_context = || format!("failed to get pane at position {point:?}"); if tab.floating_panes.panes_are_vis...
rust_dataset_chunk_515212
rust_dataset.txt
515,212
512
zellij_utils::input::config_settings::default_config() .mousebinds .clone(), input_mode: InputMode::Normal, click_count: 1, press_owner: None, } } fn custom_mousebinds(text: &str) -> Arc<Mousebinds> { zellij_utils::input::conf...
rust_dataset_chunk_515213
rust_dataset.txt
515,213
512
( Some(&previous), MouseButton::Left, &none, Position::new(2, 4), now ), 1 ); let late = now + std::time::Duration::from_millis(CLICK_TIME_THRESHOLD_MS as u64 + 1); assert_eq!( nex...
rust_dataset_chunk_515214
rust_dataset.txt
515,214
512
::new(3, 4)), &context ) .unwrap(), MouseAction::ScrollUp { pane_id: PaneId::Terminal(1), lines: 2, app_first: false, reports: 1, } ); } #[test] fn move_pane_dragged_from_...
rust_dataset_chunk_515215
rust_dataset.txt
515,215
512
: false, edge: None, is_floating: false, terminal_wants_mouse: false, is_unselectable_plugin: false, } } fn context_with(details: ClickedPaneDetails) -> MouseEventContext { let mut context = mouse_event_context(true); context.pane_id_at_po...
rust_dataset_chunk_515216
rust_dataset.txt
515,216
512
fn right_press_on_unfocused_pane_opens_menu_without_focusing_it() { let position = Position::new(3, 4); let context = context_with(clicked(PaneId::Terminal(2))); let event = MouseEvent::new_right_press_event(position); assert_eq!( MouseHandler::determine_mouse_action(&eve...
rust_dataset_chunk_515217
rust_dataset.txt
515,217
512
} ); } #[test] fn right_press_outside_any_pane_does_nothing() { let mut context = mouse_event_context(true); context.pane_id_at_position = None; let event = MouseEvent::new_right_press_event(Position::new(3, 4)); assert_eq!( MouseHandler::dete...
rust_dataset_chunk_515218
rust_dataset.txt
515,218
512
let context = menu_off(details); let event = MouseEvent::new_right_press_event(position); assert_eq!( MouseHandler::determine_mouse_action(&event, &context).unwrap(), MouseAction::SendToTerminal { pane_id: PaneId::Terminal(1), event, }...
rust_dataset_chunk_515219
rust_dataset.txt
515,219
512
MouseAction::Ungroup ); } #[test] fn left_press_on_pin_button_still_toggles_pin() { let position = Position::new(0, 4); let mut details = clicked(PaneId::Terminal(1)); details.on_frame = true; details.frame_intercepted = true; let context = context_with(deta...
rust_dataset_chunk_515220
rust_dataset.txt
515,220
512
; details.edge = Some(PaneEdge::Top); let context = context_with(details); let event = MouseEvent::new_left_press_with_ctrl_event(position); assert_eq!( MouseHandler::determine_mouse_action(&event, &context).unwrap(), MouseAction::StartResize { pan...
rust_dataset_chunk_515221
rust_dataset.txt
515,221
512
(position), &context ) .unwrap(), MouseAction::ContinueDrawingPane { position } ); assert_eq!( MouseHandler::determine_mouse_action( &MouseEvent::new_left_release_event(position), &context ) ...
rust_dataset_chunk_515222
rust_dataset.txt
515,222
512
let ctrl_click = MouseEvent::new_left_press_with_ctrl_event(position); let mut shift_click = MouseEvent::new_left_press_event(position); shift_click.shift = true; for (event, modifier) in [ (ctrl_click, zellij_utils::data::KeyModifier::Ctrl), (shift_click, zellij_...
rust_dataset_chunk_515223
rust_dataset.txt
515,223
512
context ) .unwrap(), MouseAction::ScrollDown { pane_id: PaneId::Terminal(1), lines: 2, app_first: true, reports: 2, } ); } #[test] fn ctrl_and_alt_wheels_ignore_the_line_count() { ...
rust_dataset_chunk_515224
rust_dataset.txt
515,224
512
PartialEq, Eq)] pub struct PopupBehavior { pub focused: bool, pub capture_all_keys: bool, pub outside_click: OutsideClick, pub menu: bool, } impl PopupBehavior { pub fn menu() -> Self { PopupBehavior { focused: true, capture_all_keys: false, outside_clic...
rust_dataset_chunk_515225
rust_dataset.txt
515,225
512
ating_sub(1)); let anchor_column = anchor .column .0 .max(bounds.x) .min(right_edge.saturating_sub(1)); let x = if anchor_column + cols <= right_edge { anchor_column } else { right_edge.saturating_sub(cols) }; let y = if anchor_line + rows <= bottom_ed...
rust_dataset_chunk_515226
rust_dataset.txt
515,226
512
_stack( popups: &[(PopupPlacement, usize, usize)], bounds: Viewport, ) -> Vec<PaneGeom> { let mut geoms: Vec<Option<PaneGeom>> = vec![None; popups.len()]; let mut rows_taken_per_corner: Vec<(PopupCorner, usize)> = vec![]; for (index, (placement, wanted_cols, wanted_rows)) in popups.iter().enumerate(...
rust_dataset_chunk_515227
rust_dataset.txt
515,227
512
column)), _ => None, } } impl Tab { pub fn open_popup( &mut self, client_id: ClientId, plugin_id: u32, placement: PopupPlacement, behavior: PopupBehavior, wanted_cols: usize, wanted_rows: usize, invoked_with: Option<Run>, title: S...
rust_dataset_chunk_515228
rust_dataset.txt
515,228
512
mut Popup> { self.popups .values_mut() .flat_map(|stack| stack.iter_mut()) .find(|popup| popup.plugin_id() == Some(plugin_id)) } pub fn hold_back_popup(&mut self, plugin_id: u32) { if let Some(popup) = self.popup_with_plugin_id_mut(plugin_id) { pop...
rust_dataset_chunk_515229
rust_dataset.txt
515,229
512
anted_rows)) .collect(); let geoms = place_popup_stack(&wanted, bounds); let mut resized = vec![]; for (popup, geom) in stack.iter_mut().zip(geoms.into_iter()) { let changed = geom != popup.pane.current_geom(); if changed { popup.pane.set_geom(...
rust_dataset_chunk_515230
rust_dataset.txt
515,230
512
self.mark_popups_for_full_render(); self.set_force_render(); let _ = self.update_input_modes(); } pub fn close_focused_popups(&mut self, client_id: ClientId) -> Vec<u32> { self.remove_popups_where(client_id, |popup| popup.behavior.focused) } fn remove_popups_where( &mut ...
rust_dataset_chunk_515231
rust_dataset.txt
515,231
512
_popups_where(client_id, |popup| { popup .anchor_pane .map(|pane_id| missing_anchors.contains(&pane_id)) .unwrap_or(false) }); closed.extend(removed.into_iter().map(|plugin_id| (client_id, plugin_id))); } ...
rust_dataset_chunk_515232
rust_dataset.txt
515,232
512
.iter()) .find(|popup| popup.plugin_id() == Some(plugin_id)) .map(|popup| popup.behavior) } #[cfg(test)] pub fn has_popup_for_client(&self, client_id: ClientId) -> bool { self.popups .get(&client_id) .map(|stack| !stack.is_empty()) .unwrap_...
rust_dataset_chunk_515233
rust_dataset.txt
515,233
512
_layer_of(&self, client_id: ClientId, plugin_id: u32) -> Option<usize> { let stack = self.popups.get(&client_id)?; let mut drawing_order: Vec<&Popup> = stack.iter().filter(|popup| !popup.held_back).collect(); drawing_order.sort_by_key(|popup| popup.takes_focus()); drawing_ord...
rust_dataset_chunk_515234
rust_dataset.txt
515,234
512
}, _ => {}, } true } pub fn set_popup_awaiting_permission( &mut self, plugin_id: u32, awaiting_permission: bool, ) -> Option<ClientId> { let client_id = self.popup_client_for_plugin(plugin_id)?; let stack = self.popups.get_mut(&...
rust_dataset_chunk_515235
rust_dataset.txt
515,235
512
self.mark_popups_for_full_render(); self.set_force_render(); let _ = self.update_input_modes(); Some((client_id, popup.pane)) } pub fn popup_to_floating_pane( &mut self, plugin_id: u32, coordinates: Option<zellij_utils::data::FloatingPaneCoordinates>, ) -> Re...
rust_dataset_chunk_515236
rust_dataset.txt
515,236
512
fn resize_popup(&mut self, plugin_id: u32, wanted_cols: usize, wanted_rows: usize) { let Some(client_id) = self.popup_client_for_plugin(plugin_id) else { return; }; if let Some(popup) = self.popups.get_mut(&client_id).and_then(|stack| { stack .iter_mut() ...
rust_dataset_chunk_515237
rust_dataset.txt
515,237
512
.map(|plugin_id| (plugin_id, popup.takes_focus())) } else { None } }) } pub fn unfocused_popup_plugin_ids(&self, client_id: ClientId) -> Vec<u32> { self.popups .get(&client_id) .map(|stack| { stack ...
rust_dataset_chunk_515238
rust_dataset.txt
515,238
512
let Some(mouse) = mouse_event_for_plugin(event, line, column) { self.send_mouse_to_popup_plugin(plugin_id, client_id, mouse); } Some(PopupMouseOutcome::Consumed) } fn handle_info_popup_mouse_event( &mut self, event: &MouseEvent, client_id: ClientId, ) -> ...
rust_dataset_chunk_515239
rust_dataset.txt
515,239
512
client_id, mouse); true } pub(crate) fn render_popups( &mut self, output: &mut Output, force: bool, draw_live_views: bool, ) -> Result<()> { let err_context = || "failed to render popups".to_string(); let connected_clients: Vec<ClientId> = ...
rust_dataset_chunk_515240
rust_dataset.txt
515,240
512
crate::pane_mirror::LiveViewRect::new( popup.pane.get_content_x(), popup.pane.get_content_y(), popup.pane.get_content_columns(), popup.pane.get_content_rows(), ); let link_handler = o...
rust_dataset_chunk_515241
rust_dataset.txt
515,241
512
lines: Vec<usize> = geoms.iter().map(|g| g.y).collect(); assert_eq!(lines, vec![9, 6, 1]); } #[test] fn bottom_corner_popups_stack_upwards() { let geoms = place_popup_stack( &[ popup_in(PopupCorner::BottomLeft, 4), popup_in(PopupCorner::BottomLef...
rust_dataset_chunk_515242
rust_dataset.txt
515,242
512
{ let geom = place_popup(Position::new(5, 10), 20, 30, viewport_between_bars()); assert_eq!((geom.y, geom.rows.as_usize()), (1, 18)); } #[test] fn popup_opens_below_right_of_the_pointer_when_there_is_room() { let geom = place_popup(Position::new(5, 10), 20, 8, screen()); as...
rust_dataset_chunk_515243
rust_dataset.txt
515,243
512
80, 20)); } } --- FILE: zellij/zellij-server/src/tab/swap_layouts.rs --- use crate::panes::{FloatingPanes, TiledPanes}; use std::cell::RefCell; use std::collections::BTreeMap; use std::rc::Rc; use zellij_utils::{ input::layout::{ FloatingPaneLayout, LayoutConstraint, SwapFloatingLayout, SwapTiledLayou...
rust_dataset_chunk_515244
rust_dataset.txt
515,244
512
base_swap_tiled_layout.insert(LayoutConstraint::ExactPanes(tiled_panes_count), layout.0); base_swap_floating_layout .insert(LayoutConstraint::ExactPanes(floating_panes_count), layout.1); self.swap_tiled_layouts .insert(0, (base_swap_tiled_layout, Some("BASE".into()))); ...
rust_dataset_chunk_515245
rust_dataset.txt
515,245
512
bool) { // (swap_layout_name, is_swap_layout_dirty) match self .swap_floating_layouts .iter() .nth(self.current_floating_layout_position) { Some(current_floating_layout) => ( current_floating_layout.1.clone().or_else(|| { ...
rust_dataset_chunk_515246
rust_dataset.txt
515,246
512
max_panes, LayoutConstraint::MinPanes(min_panes) => pane_count >= *min_panes, LayoutConstraint::ExactPanes(exact_panes) => pane_count == *exact_panes, LayoutConstraint::NoConstraint => true, } } fn tiled_layout_candidate( &self, swap_layout: &SwapTiled...
rust_dataset_chunk_515247
rust_dataset.txt
515,247
512
(layout_name)) .find_map(|(position, layout)| { self.floating_layout_candidate(layout, pane_count) .map(|layout| (position, layout)) }) } pub fn set_current_tiled_layout_position(&mut self, position: usize) { self.current_tiled_layout_position ...
rust_dataset_chunk_515248
rust_dataset.txt
515,248
512
ImageStore; use crate::panes::sixel::SixelImageStore; use crate::panes::{FloatingPanes, TiledPanes}; use crate::panes::{LinkHandler, PaneId}; use crate::plugins::PluginInstruction; use crate::pty::PtyInstruction; use crate::tab::layout_applier::LayoutApplier; use crate::{os_input_output::ServerOsApi, thread_bus::Thread...
rust_dataset_chunk_515249
rust_dataset.txt
515,249
512
self, _pid: u32) -> Result<()> { unimplemented!() } fn force_kill(&self, _pid: u32) -> Result<()> { unimplemented!() } fn box_clone(&self) -> Box<dyn ServerOsApi> { Box::new((*self).clone()) } fn send_to_client(&self, _client_id: ClientId, _msg: ServerToClientMsg) -> R...
rust_dataset_chunk_515250
rust_dataset.txt
515,250
512
Creates all the fixtures needed for LayoutApplier tests #[allow(clippy::type_complexity)] fn create_layout_applier_fixtures( size: Size, ) -> ( Rc<RefCell<Viewport>>, ThreadSenders, Rc<RefCell<SixelImageStore>>, Rc<RefCell<LinkHandler>>, Rc<RefCell<Palette>>, Rc<RefCell<HashMap<usize, Strin...
rust_dataset_chunk_515251
rust_dataset.txt
515,251
512
Cell::new(HashMap::new())); let fullscreen_covers_ui = Rc::new(RefCell::new(false)); let session_is_mirrored = true; let draw_pane_frames = PaneFrameStyle::Full; let default_mode_info = ModeInfo::default(); let tiled_panes = TiledPanes::new( display_area.clone(), viewport.clone(), ...
rust_dataset_chunk_515252
rust_dataset.txt
515,252
512
<RefCell<HashMap<usize, String>>>, Rc<RefCell<Option<SizeInPixels>>>, Rc<RefCell<HashMap<ClientId, bool>>>, Style, Rc<RefCell<Size>>, TiledPanes, FloatingPanes, PaneFrameStyle, Option<PaneId>, Box<dyn ServerOsApi>, bool, bool, bool, bool, bool, Receiver<(PtyIn...
rust_dataset_chunk_515253
rust_dataset.txt
515,253
512
::new(RefCell::new(HashMap::new())); let fullscreen_covers_ui = Rc::new(RefCell::new(false)); let session_is_mirrored = true; let draw_pane_frames = PaneFrameStyle::Full; let default_mode_info = ModeInfo::default(); let tiled_panes = TiledPanes::new( display_area.clone(), viewport.c...
rust_dataset_chunk_515254
rust_dataset.txt
515,254
512
<RefCell<Size>>, ) -> String { let mut output = String::new(); // Viewport info let viewport_state = viewport.borrow(); writeln!( &mut output, "VIEWPORT: x={}, y={}, cols={}, rows={}", viewport_state.x, viewport_state.y, viewport_state.cols, viewport_state.rows ) .unwrap...
rust_dataset_chunk_515255
rust_dataset.txt
515,255
512
ane_ids().count() ) .unwrap(); let mut floating_list: Vec<_> = floating_panes.get_panes().collect(); floating_list.sort_by_key(|(id, _)| **id); for (pane_id, pane) in floating_list { let geom = pane.position_and_size(); let run = pane.invoked_with(); ...
rust_dataset_chunk_515256
rust_dataset.txt
515,256
512
&Receiver<(PtyInstruction, zellij_utils::errors::ErrorContext)>, ) -> Vec<PaneId> { let mut closed_panes = Vec::new(); while let Ok((instruction, _)) = pty_receiver.try_recv() { if let PtyInstruction::ClosePane(pane_id, _) | PtyInstruction::ClosePaneThatWasNotCreated(pane_id, _) = instruction ...
rust_dataset_chunk_515257
rust_dataset.txt
515,257
512
os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disable_kitty_keyboard_protocol, None, // blocking_terminal ); let result = applier.apply_layout( tiled_layout, floating_layout, terminal_ids, vec![], ...
rust_dataset_chunk_515258
rust_dataset.txt
515,258
512
( tiled_layout, floating_layout, terminal_ids, vec![], HashMap::new(), 1, ) .unwrap(); let snapshot = take_pane_state_snapshot( &tiled_panes, &floating_panes, &focus_pane_id, &viewport, &...
rust_dataset_chunk_515259
rust_dataset.txt
515,259
512
_id, &viewport, &display_area, )); } #[test] fn test_apply_horizontal_split_with_sizes() { let kdl_layout = r#" layout { pane split_direction="Horizontal" { pane size="30%" pane size="70%" } } "#; let (tiled_layout...
rust_dataset_chunk_515260
rust_dataset.txt
515,260
512
} } "#; let (tiled_layout, floating_layout) = parse_kdl_layout(kdl_layout); let terminal_ids = vec![(1, None), (2, None)]; let size = Size { cols: 100, rows: 50, }; let ( viewport, senders, sixel_image_store, link_handler, ...
rust_dataset_chunk_515261
rust_dataset.txt
515,261
512
None)]; let size = Size { cols: 120, rows: 40, }; let ( viewport, senders, sixel_image_store, link_handler, terminal_emulator_colors, terminal_emulator_color_codes, character_cell_size, connected_clients, style, ...
rust_dataset_chunk_515262
rust_dataset.txt
515,262
512
style, display_area, mut tiled_panes, mut floating_panes, draw_pane_frames, mut focus_pane_id, os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disable_kitty_keyboard_protocol, ) = create_layout_applie...
rust_dataset_chunk_515263
rust_dataset.txt
515,263
512
os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disable_kitty_keyboard_protocol, ) = create_layout_applier_fixtures(size); let mut applier = LayoutApplier::new( &viewport, &senders, &sixel_image_store, &R...
rust_dataset_chunk_515264
rust_dataset.txt
515,264
512
, &senders, &sixel_image_store, &Rc::new(RefCell::new(KittyImageStore::default())), &link_handler, &terminal_emulator_colors, &terminal_emulator_color_codes, &character_cell_size, &connected_clients, &style, &display_area, &mut tile...
rust_dataset_chunk_515265
rust_dataset.txt
515,265
512
&connected_clients, &style, &display_area, &mut tiled_panes, &mut floating_panes, draw_pane_frames, &mut focus_pane_id, &os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disable_kitty_keyboard_prot...
rust_dataset_chunk_515266
rust_dataset.txt
515,266
512
&mut tiled_panes, &mut floating_panes, draw_pane_frames, &mut focus_pane_id, &os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disable_kitty_keyboard_protocol, None, ); let (should_show_floating, _stack_o...
rust_dataset_chunk_515267
rust_dataset.txt
515,267
512
tiled_panes, &mut floating_panes, draw_pane_frames, &mut focus_pane_id, &os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disable_kitty_keyboard_protocol, None, ); applier .apply_layout( ...
rust_dataset_chunk_515268
rust_dataset.txt
515,268
512
mut applier = LayoutApplier::new( &viewport, &senders, &sixel_image_store, &Rc::new(RefCell::new(KittyImageStore::default())), &link_handler, &terminal_emulator_colors, &terminal_emulator_color_codes, &character_cell_size, &connected_clients, ...
rust_dataset_chunk_515269
rust_dataset.txt
515,269
512
debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disable_kitty_keyboard_protocol, ) = create_layout_applier_fixtures(size); let mut applier = LayoutApplier::new( &viewport, &senders, &sixel_image_store, &Rc::new(RefCell::...
rust_dataset_chunk_515270
rust_dataset.txt
515,270
512
oved_from_last_to_first_preserves_order() { let initial_kdl = r#" layout { pane pane pane pane command="sleep" } "#; let (tiled_layout, floating_layout) = parse_kdl_layout(initial_kdl); let terminal_ids = vec![(1, None), (2, None), (3, Non...
rust_dataset_chunk_515271
rust_dataset.txt
515,271
512
)| pane.position_and_size().y); assert_eq!( panes.into_iter().map(|(id, _)| *id).collect::<Vec<_>>(), [4, 1, 2, 3].map(PaneId::Terminal), "Moving a command pane from last to first must preserve the other panes' relative order" ); } #[test] fn test_reapply_layout_logical_position_match()...
rust_dataset_chunk_515272
rust_dataset.txt
515,272
512
different split // This tests logical position matching (position 0, 1, 2) without exact command match let new_kdl = r#" layout { pane split_direction="Vertical" { pane size="50%" pane size="50%" } pane } "#; let (new_...
rust_dataset_chunk_515273
rust_dataset.txt
515,273
512
ane_id, &os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disable_kitty_keyboard_protocol, None, ); applier .apply_layout( tiled_layout, floating_layout, terminal_ids, vec![...
rust_dataset_chunk_515274
rust_dataset.txt
515,274
512
RefCell::new(KittyImageStore::default())), &link_handler, &terminal_emulator_colors, &terminal_emulator_color_codes, &character_cell_size, &connected_clients, &style, &display_area, &mut tiled_panes, &mut floating_panes, draw_pane_frames, ...
rust_dataset_chunk_515275
rust_dataset.txt
515,275
512
mut tiled_panes, mut floating_panes, draw_pane_frames, mut focus_pane_id, os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disable_kitty_keyboard_protocol, ) = create_layout_applier_fixtures(size); let mut applie...
rust_dataset_chunk_515276
rust_dataset.txt
515,276
512
mut focus_pane_id, os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disable_kitty_keyboard_protocol, ) = create_layout_applier_fixtures(size); let mut applier = LayoutApplier::new( &viewport, &senders, &si...
rust_dataset_chunk_515277
rust_dataset.txt
515,277
512
terminal_emulator_colors, terminal_emulator_color_codes, character_cell_size, connected_clients, style, display_area, mut tiled_panes, mut floating_panes, draw_pane_frames, mut focus_pane_id, os_api, debug, arrow_fon...
rust_dataset_chunk_515278
rust_dataset.txt
515,278
512
let status_bar_plugin = RunPluginOrAlias::from_url("zellij:status-bar", &None, None, None).unwrap(); new_plugin_ids.insert(tab_bar_plugin, vec![100]); new_plugin_ids.insert(status_bar_plugin, vec![101]); let size = Size { cols: 120, rows: 40, }; let ( viewport, ...
rust_dataset_chunk_515279
rust_dataset.txt
515,279
512
="60%" split_direction="Horizontal" { pane command="vim" pane command="cargo" { args "watch" "-x" "test" } } pane size="20%" { plugin location="zellij:compact-bar" } ...
rust_dataset_chunk_515280
rust_dataset.txt
515,280
512
_ids, 1, ) .unwrap(); // Snapshot should show: // - 2 terminal panes with commands // - 2 plugin panes with different locations // - Correct size distribution (20%, 60%, 20%) assert_snapshot!(take_pane_state_snapshot( &tiled_panes, &floating_panes, ...
rust_dataset_chunk_515281
rust_dataset.txt
515,281
512
_ids, 1, ); assert!(result.is_ok()); assert!(tiled_panes.panes_contain(&PaneId::Terminal(1))); assert_eq!(tiled_panes.visible_panes_count(), 1); } #[test] fn test_apply_layout_with_excess_terminal_ids() { let kdl_layout = r#" layout { pane pane } ...
rust_dataset_chunk_515282
rust_dataset.txt
515,282
512
, &floating_panes, &focus_pane_id, &viewport, &display_area, )); } #[test] fn test_override_layout_basic_with_both_tiled_and_floating() { // Setup: Apply initial layout with 2 tiled panes + 1 floating pane let initial_kdl = r#" layout { pane command="htop...
rust_dataset_chunk_515283
rust_dataset.txt
515,283
512
floating_terminal_ids, HashMap::new(), 1, ) .unwrap(); // Now override with different layout (2 tiled + 1 floating) let override_kdl = r#" layout { pane command="top" pane command="htop" floating_panes { pane {...
rust_dataset_chunk_515284
rust_dataset.txt
515,284
512
initial_floating) = parse_kdl_layout(initial_kdl); let terminal_ids = vec![(1, None)]; let floating_terminal_ids = vec![(2, None)]; let size = Size { cols: 100, rows: 50, }; let ( viewport, senders, sixel_image_store, link_handler, terminal_e...
rust_dataset_chunk_515285
rust_dataset.txt
515,285
512
= false; let retain_existing_plugin_panes = false; let (should_show_floating, _stack_orientations) = applier .override_layout( override_tiled, override_floating, new_terminal_ids, new_floating_terminal_ids, HashMap::new(), retain_e...
rust_dataset_chunk_515286
rust_dataset.txt
515,286
512
_codes, &character_cell_size, &connected_clients, &style, &display_area, &mut tiled_panes, &mut floating_panes, draw_pane_frames, &mut focus_pane_id, &os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, ...
rust_dataset_chunk_515287
rust_dataset.txt
515,287
512
layout with 3 panes running different commands let initial_kdl = r#" layout { pane command="htop" pane command="vim" pane command="tail" { args "-f" "/var/log/syslog" } } "#; let (initial_tiled, initial_floating) = parse_kdl_l...
rust_dataset_chunk_515288
rust_dataset.txt
515,288
512
override_tiled_panes_layout_for_existing_panes( &override_tiled, vec![], &mut HashMap::new(), false, false, 1, ) .unwrap(); // htop and vim panes should be preserved (same PaneIds: Terminal(1) and Terminal(2)) // tail pane ...
rust_dataset_chunk_515289
rust_dataset.txt
515,289
512
ty_receiver, plugin_receiver, ) = create_layout_applier_fixtures_with_receivers(size); let mut applier = LayoutApplier::new( &viewport, &senders, &sixel_image_store, &Rc::new(RefCell::new(KittyImageStore::default())), &link_handler, &terminal_emulator_col...
rust_dataset_chunk_515290
rust_dataset.txt
515,290
512
test_override_tiled_all_panes_closed_no_matches() { // Setup: 3 panes running htop, vim, tail let initial_kdl = r#" layout { pane command="htop" pane command="vim" pane command="tail" { args "-f" "/var/log/syslog" } } "#; ...
rust_dataset_chunk_515291
rust_dataset.txt
515,291
512
} pane command="python" { args "-m" "http.server" } } "#; let (override_tiled, _) = parse_kdl_layout(override_kdl); let new_terminal_ids = vec![(4, None), (5, None), (6, None)]; applier .override_tiled_panes_layout_for_existing_panes( ...
rust_dataset_chunk_515292
rust_dataset.txt
515,292
512
_area, mut tiled_panes, mut floating_panes, draw_pane_frames, mut focus_pane_id, os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disable_kitty_keyboard_protocol, pty_receiver, plugin_receiver, ...
rust_dataset_chunk_515293
rust_dataset.txt
515,293
512
); assert!(unloaded_plugins.is_empty()); assert_snapshot!(take_pane_state_snapshot( &tiled_panes, &floating_panes, &focus_pane_id, &viewport, &display_area, )); } #[test] fn test_override_tiled_new_panes_for_unmatched_positions() { // Setup: 1 pane running htop ...
rust_dataset_chunk_515294
rust_dataset.txt
515,294
512
override_tiled, _) = parse_kdl_layout(override_kdl); let new_terminal_ids = vec![(2, None), (3, None), (4, None)]; applier .override_tiled_panes_layout_for_existing_panes( &override_tiled, new_terminal_ids, &mut HashMap::new(), false, false, ...
rust_dataset_chunk_515295
rust_dataset.txt
515,295
512
, &os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disable_kitty_keyboard_protocol, None, ); applier .apply_layout( initial_tiled, initial_floating, terminal_ids, vec![], ...
rust_dataset_chunk_515296
rust_dataset.txt
515,296
512
_disable_kitty_keyboard_protocol, pty_receiver, plugin_receiver, ) = create_layout_applier_fixtures_with_receivers(size); let mut applier = LayoutApplier::new( &viewport, &senders, &sixel_image_store, &Rc::new(RefCell::new(KittyImageStore::default())), &l...
rust_dataset_chunk_515297
rust_dataset.txt
515,297
512
_snapshot( &tiled_panes, &floating_panes, &focus_pane_id, &viewport, &display_area, )); } #[test] fn test_override_tiled_empty_layout_closes_all() { // Setup: 3 panes running various commands let initial_kdl = r#" layout { pane command="htop" ...
rust_dataset_chunk_515298
rust_dataset.txt
515,298
512
} "#; let (override_tiled, _) = parse_kdl_layout(override_kdl); applier .override_tiled_panes_layout_for_existing_panes( &override_tiled, vec![], &mut HashMap::new(), false, false, 1, ) .unwrap(); ...
rust_dataset_chunk_515299
rust_dataset.txt
515,299
512
character_cell_size, connected_clients, style, display_area, mut tiled_panes, mut floating_panes, draw_pane_frames, mut focus_pane_id, os_api, debug, arrow_fonts, styled_underlines, osc8_hyperlinks, explicitly_disab...