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_513200
rust_dataset.txt
513,200
512
, search_results: Default::default(), sixel_grid, kitty_grid, kitty_parser: KittyCommandParser::new(), kitty_host_support: KittyHostSupport::Supported, sixel_host_support: true, pending_clipboard_update: None, pending_osc7_c...
rust_dataset_chunk_513201
rust_dataset.txt
513,201
512
self.mouse_tracking = MouseTracking::Off; self.focus_event_tracking = false; self.supports_kitty_keyboard_protocol = false; self.color_palette_notification_enabled = false; } pub fn update_line_for_rendering(&mut self, line_index: usize) { self.output_buffer.update_line(l...
rust_dataset_chunk_513202
rust_dataset.txt
513,202
512
(); let wants_mouse = self.mouse_tracking != MouseTracking::Off; let link_handler = self.link_handler.borrow(); let mut screen = crate::output::mirror_screen_from_chunks( chunks, self.width, self.height, self.styled_underlines, &link_ha...
rust_dataset_chunk_513203
rust_dataset.txt
513,203
512
1; } if i == y { break; } } canonical_line_index } // TODO: merge these two functions fn cursor_index_in_canonical_line(&self) -> usize { let mut cursor_canonical_line_index = 0; let mut cursor_index_in_canonical_line = 0; ...
rust_dataset_chunk_513204
rust_dataset.txt
513,204
512
y; } last_y } fn kitty_canonical_line_starts(&self) -> Vec<usize> { let mut starts = Vec::new(); let mut wrapped_row = 0usize; for row in self .lines_above .iter() .chain(self.viewport.iter()) .chain(self.lines_below.iter()...
rust_dataset_chunk_513205
rust_dataset.txt
513,205
512
itty_settle_placements_below_the_viewport(); if self.kitty_grid.placement_count() == 0 { return; } let cell_height = match *self.character_cell_size.borrow() { Some(cell) => cell.height as isize, None => return, }; let starts = self.kitty_canon...
rust_dataset_chunk_513206
rust_dataset.txt
513,206
512
); } // Move all search-selections down one line as well found_something = self .search_results .move_down(1, &self.viewport, self.height); } self.output_buffer.update_all_lines(); found_something } pub fn scroll_down_on...
rust_dataset_chunk_513207
rust_dataset.txt
513,207
512
) { self.scrollback_display_rows = self.scrollback_display_rows.saturating_add_signed(delta); } fn recount_scrollback_display_rows(&mut self, new_columns: usize) { self.scrollback_display_rows = scrollback_display_row_count(&mut self.lines_above, new_columns); } pub fn change...
rust_dataset_chunk_513208
rust_dataset.txt
513,208
512
{ let mut first_line_above = Row::from_rows( get_lines_above_bottom_canonical_row_and_wraps(&mut self.lines_above), ); first_line_above.append(&mut row); viewport_canonical_lines.push(first_line_above...
rust_dataset_chunk_513209
rust_dataset.txt
513,209
512
the line, matching the old `break` behavior if canonical_line_parts.is_empty() { continue; } new_viewport_rows.append(&mut canonical_line_parts); } self.viewport = VecDeque::from(new_viewport_rows); let cursor_lin...
rust_dataset_chunk_513210
rust_dataset.txt
513,210
512
} Some(new_x) }, _ => None, }; Some(( new_cursor_y, saved_cursor_y_coordinates, new_cursor_x, saved_cursor_x_coordinates, )) } else if new_...
rust_dataset_chunk_513211
rust_dataset.txt
513,211
512
_lines_above( &mut self.viewport, &mut self.lines_above, &mut self.sixel_grid, &mut self.kitty_grid, row_count_to_transfer, new_columns, ); ...
rust_dataset_chunk_513212
rust_dataset.txt
513,212
512
.sixel_grid.has_images() && self.kitty_grid.placement_count() == 0 && self.search_results.selections.is_empty() && self.selection.is_empty() && self.viewport.len() == self.height && self.lines_below.is_empty(); if !shiftable { return None; ...
rust_dataset_chunk_513213
rust_dataset.txt
513,213
512
) = self.sixel_grid.drain_image_ids_to_reap() { self.sixel_grid.reap_images(image_ids_to_reap); } let changed_sixel_image_chunks = self.sixel_grid.changed_sixel_chunks_in_viewport( changed_rects, self.lines_above.len(), self.width, x_offset, ...
rust_dataset_chunk_513214
rust_dataset.txt
513,214
512
>, )>, > { if self.lock_renders { if !self.render_lock_outlived_its_cap() { return Ok(None); } self.unlock_renders(); } let raw_vte_output = String::new(); let (mut character_chunks, sixel_image_chunks, kitty_image_chunks) ...
rust_dataset_chunk_513215
rust_dataset.txt
513,215
512
( style.colors.text_unselected.emphasis_2, style.colors.text_unselected.background, ) }; let background_color = match select_background_palette { ...
rust_dataset_chunk_513216
rust_dataset.txt
513,216
512
_coordinates(&self) -> Option<(usize, usize, bool)> { if self.cursor.x >= self.width || self.cursor.y >= self.height { None } else { Some((self.cursor.x, self.cursor.y, !self.cursor_is_hidden)) } } pub fn is_mid_frame(&self) -> bool { self.lock_renders ...
rust_dataset_chunk_513217
rust_dataset.txt
513,217
512
_above, cursor_y)| (lines_above + cursor_y).saturating_sub(skip)) .filter(|row| *row < rows.len()) .or_else(|| self.last_output_marker_row(&rows)), }; let anchor_line = anchor_row.map(|row| { rows.iter() .take(row + 1) .skip(1) ...
rust_dataset_chunk_513218
rust_dataset.txt
513,218
512
scroll_region_top && self.cursor.y <= scroll_region_bottom { let mut pad_character = EMPTY_TERMINAL_CHARACTER; pad_character.styles = self.cursor.pending_styles.clone(); let columns = vec![pad_character; self.width]; self.scroll_region_content_down( ...
rust_dataset_chunk_513219
rust_dataset.txt
513,219
512
0 && region_top == 0 && self.alternate_screen_state.is_none() && !self.viewport.is_empty() { self.transfer_rows_to_lines_above(1); self.selection.move_up(1); RegionRowsScrolled::IntoScrollback } else if at < self.viewport.len() { ...
rust_dataset_chunk_513220
rust_dataset.txt
513,220
512
_row * cell_h; self.kitty_grid.apply_region_scroll( region_top_px, region_bottom_px, n * cell_h, la_delta_px, viewport_top_px, preserve_above_region_top, ); self.kitty_grid ...
rust_dataset_chunk_513221
rust_dataset.txt
513,221
512
(); } else { self.cursor.y += 1; self.output_buffer.update_line(self.cursor.y); } } pub fn move_cursor_to_beginning_of_line(&mut self) { self.cursor.x = 0; } pub fn add_character_at_cursor_position( &mut self, terminal_character: TerminalCh...
rust_dataset_chunk_513222
rust_dataset.txt
513,222
512
); }, } } pub fn add_character(&mut self, terminal_character: TerminalCharacter) { let may_group = terminal_character.has_attached() || grapheme_join::new_cell_may_join_a_neighbour(terminal_character.character); self.add_fresh_character(terminal_character, may_gro...
rust_dataset_chunk_513223
rust_dataset.txt
513,223
512
_target_column() else { return; }; let pane_width = self.width; let grapheme_mode = self.grapheme_mode; let insert_mode = self.insert_mode; let auto_wrap = !self.disable_linewrap; let Some(row) = self.viewport.get_mut(self.cursor.y) else { return; ...
rust_dataset_chunk_513224
rust_dataset.txt
513,224
512
.viewport .get(self.cursor.y) .and_then(|row| row.columns.get(index)) .cloned() { self.set_preceding_character(cell); } }, } } pub fn get_character_under_cursor...
rust_dataset_chunk_513225
rust_dataset.txt
513,225
512
_line_before_cursor(replace_with); for row in self.viewport.iter_mut().take(self.cursor.y) { row.replace_columns(replace_with_columns.clone()); } self.output_buffer.update_all_lines(); // TODO: only update the changed lines } } pub fn clear_cursor_line...
rust_dataset_chunk_513226
rust_dataset.txt
513,226
512
()); } if let Some(current_row) = self.viewport.get_mut(self.cursor.y) { let mut effective_pad = pad_character; if let Some(bg_color) = current_row.bg_color { if matches!( effective_pad.styles.background, Some(AnsiCode::Rese...
rust_dataset_chunk_513227
rust_dataset.txt
513,227
512
(scroll_region_top, scroll_region_bottom) = self.scroll_region; for _ in 0..count { let current_line_index = self.cursor.y; if current_line_index == scroll_region_top { // if we're at the top line, we create a new line and remove the last line that // wou...
rust_dataset_chunk_513228
rust_dataset.txt
513,228
512
_viewport_size(&mut self) { self.scroll_region = (0, self.height.saturating_sub(1)); } pub fn delete_lines_in_scroll_region( &mut self, count: usize, pad_character: TerminalCharacter, ) { let (scroll_region_top, scroll_region_bottom) = self.scroll_region; let ...
rust_dataset_chunk_513229
rust_dataset.txt
513,229
512
{ self.cursor.y = std::cmp::min(self.height - 1, line); self.pad_lines_until(self.cursor.y, pad_character); let pad_character = EMPTY_TERMINAL_CHARACTER; self.pad_current_line_until(self.cursor.x, pad_character); } pub fn replace_with_empty_chars(&mut self, count: usize, empty_c...
rust_dataset_chunk_513230
rust_dataset.txt
513,230
512
_placements(); } self.invalidate_scroll_offset(); self.lines_above = VecDeque::new(); self.lines_below = VecDeque::new(); self.is_scrolled = false; self.viewport = VecDeque::from(vec![Row::with_capacity(self.width).canonical()]); self.alternate_screen_state = None...
rust_dataset_chunk_513231
rust_dataset.txt
513,231
512
h in highlights { let (fg, bg) = resolve_highlight_colors(&h.style, style); if let Ok(regex) = regex::Regex::new(&h.pattern) { // Upsert: replace existing entry with same pattern and on_hover flag, or push new let on_hover = h.on_hover; if let Som...
rust_dataset_chunk_513232
rust_dataset.txt
513,232
512
Option<( HighlightLayer, u32, String, String, BTreeMap<String, String>, )> = None; for (plugin_id, pattern_map) in &self.plugin_highlights { for (pattern, compiled) in pattern_map { for mat in highlight_matches(&com...
rust_dataset_chunk_513233
rust_dataset.txt
513,233
512
) { for r in canonical..canonical + group_len { self.output_buffer.update_line(r); } } } /// Recompute the cached hover tooltip from the current hover position and /// plugin highlights. Called whenever the hover position, highlight set, or /// h...
rust_dataset_chunk_513234
rust_dataset.txt
513,234
512
} let mut selections = Vec::new(); let viewport_len = self.viewport.len(); let mut ridx = 0; while ridx < viewport_len { let (_canonical, group_len, logical_text, boundaries) = match collect_and_build_logical_line(&self.viewport, ridx) { ...
rust_dataset_chunk_513235
rust_dataset.txt
513,235
512
_matches(&compiled.regex, &logical_text) { if let Some((sel, _, _, _, _)) = match_to_selection(&mat, &boundaries, &self.viewport) { selections.push(HighlightSelection { selection: sel,...
rust_dataset_chunk_513236
rust_dataset.txt
513,236
512
_selection = self.selection; if &old_selection.end != to { if self.click.is_double_click() { let Some((word_start_position, word_end_position)) = self.word_around_position(&to) else { // no-op return; }; ...
rust_dataset_chunk_513237
rust_dataset.txt
513,237
512
(start, end); self.text_in_selection(&range_selection) } fn text_in_selection(&self, text_selection: &Selection) -> Option<String> { if text_selection.is_empty() { return None; } let mut selection: Vec<String> = vec![]; let sorted_selection = text_selection.s...
rust_dataset_chunk_513238
rust_dataset.txt
513,238
512
(|(unit_start, unit_end)| { *unit_start <= start_column && start_column < *unit_end }) .map(|(unit_start, _)| *unit_start) .unwrap_or(start_column); let widened_end = spans .iter() ...
rust_dataset_chunk_513239
rust_dataset.txt
513,239
512
(position.line.0 as usize)?; Some(position_row.last_index_in_line()) } pub fn word_around_position(&self, position: &Position) -> Option<(Position, Position)> { let position_row = self.viewport.get(position.line.0 as usize)?; let (index_start, index_end) = position_row .word_...
rust_dataset_chunk_513240
rust_dataset.txt
513,240
512
as i32, (position_row.columns.len() + position_row.excess_width()) as u16, ); let mut found_canonical_row_start = position_row.is_canonical; while !found_canonical_row_start { if let Some(row_above) = self .viewport .get(position_start.li...
rust_dataset_chunk_513241
rust_dataset.txt
513,241
512
}; let mut latest_output = None; let mut selection_start = None; 'backward: for line in (first_line..=clicked_line.min(last_line)).rev() { let Some(row) = self.row_at(line) else { continue; }; for marker in row.osc133_markers.iter().rev() { ...
rust_dataset_chunk_513242
rust_dataset.txt
513,242
512
_candidate = Some(display_delta); } }, Osc133MarkerKind::Output | Osc133MarkerKind::End(_) => { if let Some(candidate) = input_candidate { return Some(candidate); } ...
rust_dataset_chunk_513243
rust_dataset.txt
513,243
512
_command_at_scroll_position(&mut self) -> bool { let Some((start_position, end_position)) = self.osc133_command_at_scroll_position() else { return false; }; let old_selection = self.selection; self.selection .set_start_and_end_positions(start_position, end_positio...
rust_dataset_chunk_513244
rust_dataset.txt
513,244
512
} self.output_buffer.update_all_lines(); self.mark_for_rerender(); true } fn handle_reported_cwd(&mut self, cwd: zellij_utils::attention::ReportedCwd) { if cwd.is_local { if let Some(path) = crate::attention::shell::usable_local_path(&cwd.path) { ...
rust_dataset_chunk_513245
rust_dataset.txt
513,245
512
.prompt_open { self.shell_reports.prompt_open = true; self.pending_prompt_return = true; signal = Some(PaneSignal::PromptShown { aid: mark.options.aid.clone(), }); } }, MarkKin...
rust_dataset_chunk_513246
rust_dataset.txt
513,246
512
continue; }; for marker in row.osc133_markers.iter() { if let Osc133MarkerKind::End(exit_code) = marker.kind { exit_codes.push(exit_code); } } } exit_codes } fn update_selected_lines(&mut sel...
rust_dataset_chunk_513247
rust_dataset.txt
513,247
512
) -> Option<(usize, usize)> { // (x, y) if let Some(character_cell_size) = *self.character_cell_size.borrow() { let line_count_in_scrollback = self.lines_above.len(); let y_coordinates = (line_count_in_scrollback + self.cursor.y) * character_cell_size.height; ...
rust_dataset_chunk_513248
rust_dataset.txt
513,248
512
_command_handled(); let parsed = self.kitty_parser.parse(raw)?; let (result, was_query) = match parsed { Ok(command) => { let was_query = command.action == KittyAction::Query; (self.execute_kitty_command(command), was_query) }, Err(e) =...
rust_dataset_chunk_513249
rust_dataset.txt
513,249
512
image_number: command.image_number, placement_id: command.placement_id, quiet: command.quiet, }), Err(e) => Err(e), } }, KittyAction::TransmitAndDisplay | KittyAction::...
rust_dataset_chunk_513250
rust_dataset.txt
513,250
512
{ self.advance_cursor_after_kitty_placement(cols as usize, rows as usize); } self.kitty_reanchor_all_from_pixels(); self.render_full_viewport(); self.mark_for_rerender(); ...
rust_dataset_chunk_513251
rust_dataset.txt
513,251
512
value = 3; // Default to no buttons down. if event.left { value = 0; } else if event.middle { value = 1; } else if event.right { value = 2; } else if event.wheel_up { value = 64; } else if event.wheel_down { value = 65;...
rust_dataset_chunk_513252
rust_dataset.txt
513,252
512
)), (_, _) => None, } } pub fn mouse_left_click_signal(&self, position: &Position, is_held: bool) -> Option<String> { let utf8_event = || -> Option<String> { let button_code = if is_held { b'@' } else { b' ' }; let mut msg: Vec<u8> = vec![27, b'[', b'M', butt...
rust_dataset_chunk_513253
rust_dataset.txt
513,253
512
= format!( "\u{1b}[<0;{:?};{:?}m", position.column() + 1, position.line() + 1 ); Some(mouse_event) }, } } pub fn mouse_right_click_signal(&self, position: &Position, is_held: bool) -> Option<String> ...
rust_dataset_chunk_513254
rust_dataset.txt
513,254
512
() + 1, )); Some(String::from_utf8_lossy(&msg).into()) }, (MouseMode::Sgr, _) => { let mouse_event = format!( "\u{1b}[<2;{:?};{:?}m", position.column() + 1, position.line() + 1 ...
rust_dataset_chunk_513255
rust_dataset.txt
513,255
512
<u8> = vec![27, b'[', b'M', b'#']; msg.append(&mut utf8_mouse_coordinates( position.column() + 1, position.line() + 1, )); Some(String::from_utf8_lossy(&msg).into()) }, (MouseMode::Sgr, _) => { ...
rust_dataset_chunk_513256
rust_dataset.txt
513,256
512
M", position.column.0 + 1, position.line.0 + 1 ); Some(mouse_event) }, } } pub fn mouse_scroll_left_signal(&self, position: &Position) -> Option<String> { match (&self.mouse_mode, &self.mouse_tracking) { ...
rust_dataset_chunk_513257
rust_dataset.txt
513,257
512
Some("\u{1b}[O".into()) } else { None } } pub fn delete_viewport_and_scroll(&mut self) { self.invalidate_scroll_offset(); self.lines_above = VecDeque::new(); self.viewport.clear(); self.lines_below = VecDeque::new(); self.scrollback...
rust_dataset_chunk_513258
rust_dataset.txt
513,258
512
.map(|opened_at| opened_at.elapsed() >= SYNCHRONIZED_UPDATE_CAP) .unwrap_or(false) } pub fn update_theme(&mut self, theme: Styling) { self.style.colors = theme.clone(); } pub fn set_grapheme_mode_by_default(&mut self, grapheme_mode_by_default: bool) { self.graphe...
rust_dataset_chunk_513259
rust_dataset.txt
513,259
512
} PaneContents::new_with_scrollback( viewport, self.selection.start, self.selection.end, lines_above_viewport, lines_below_viewport, ) } else { PaneContents::new(viewport, self.selecti...
rust_dataset_chunk_513260
rust_dataset.txt
513,260
512
for row in &self.lines_below { lines_below_viewport.push(extract_row_with_ansi(row)); } PaneContents::new_with_scrollback( viewport, self.selection.start, self.selection.end, lines_above_viewport, ...
rust_dataset_chunk_513261
rust_dataset.txt
513,261
512
ide(c: char) -> bool { grapheme_join::is_plain_wide(c) || is_hangul_syllable(c) } #[inline(always)] fn never_joins(c: char) -> bool { (' '..='~').contains(&c) || grapheme_join::is_plain_wide(c) || is_hangul_syllable(c) } #[inline(always)] fn decode_bulk_wide(bytes: &[u8]) -> Option<char> { match bytes { ...
rust_dataset_chunk_513262
rust_dataset.txt
513,262
512
} row.width = encode_width(x + 2 * count); row.only_single_width = false; match &mut self.preceding_char { Some(preceding) if preceding.styles.ptr_eq(styles) => { preceding.copy_plain_glyph(last, 2) }, _ => { self.preceding_cha...
rust_dataset_chunk_513263
rust_dataset.txt
513,263
512
(); let bulk = !self.insert_mode && self.cursor.charsets[self.active_charset] == StandardCharset::Ascii && !self.sixel_grid.has_images(); let mut index = 0; while index < bytes.len() { if bulk { let printed = self.print_ascii_run(&bytes[index.....
rust_dataset_chunk_513264
rust_dataset.txt
513,264
512
; self.shell_reports .push(crate::attention::signals::PaneSignal::Bell); }, 8 => { // backspace self.move_cursor_back(1); }, 9 => { // tab self.advance_to_next_tabstop(self...
rust_dataset_chunk_513265
rust_dataset.txt
513,265
512
_session::NESTED_DCS_PARAM][..]) { self.nested_frame_bytes = Some(vec![]); } } fn put(&mut self, byte: u8) { if self.sixel_grid.is_parsing() { self.sixel_grid.handle_byte(byte); // we explicitly set this to false here because in the context of Sixel, ...
rust_dataset_chunk_513266
rust_dataset.txt
513,266
512
terminated { "\x07" } else { "\x1b\\" }; if params.is_empty() || params[0].is_empty() { return; } match params[0] { // Set window title. b"0" | b"2" => { if params.len() >= 2 { let title = params[1..] ...
rust_dataset_chunk_513267
rust_dataset.txt
513,267
512
()); } else if let Some(cwd) = crate::attention::shell::parse_iterm2_cwd( raw, self.shell_reports.iterm_remote_host.as_deref(), ) { self.handle_reported_cwd(cwd); } } ...
rust_dataset_chunk_513268
rust_dataset.txt
513,268
512
via // `zellij action set-pane-color` or via // a prior OSC 10;<rgb> / 11;<rgb> from // inside the pane), answer with that // override directly instead of // f...
rust_dataset_chunk_513269
rust_dataset.txt
513,269
512
} dynamic_code += 1; } } } }, b"12" => { // get/set cursor color currently unimplemented }, b"133" => { if let Some(mark) ...
rust_dataset_chunk_513270
rust_dataset.txt
513,270
512
1 { // TBD - reset all color changes - currently unsupported return; } // Reset color indexes given as parameters. for param in &params[1..] { if let Some(_index) = parse_number(param) { ...
rust_dataset_chunk_513271
rust_dataset.txt
513,271
512
b"9" => { if params.len() > 2 && params[1] == b"9" { let raw = params[2..] .iter() .flat_map(|x| str::from_utf8(x)) .collect::<Vec<&str>>() .join(";"); if let Some(cwd...
rust_dataset_chunk_513272
rust_dataset.txt
513,272
512
mediates(), sequence.final_char(), ); let mut params_iter = params.iter(); let mut next_param_or = |default: u16| { params_iter .next() .map(|param| param[0]) .filter(|&param| param != 0) .unwrap_or(default) ...
rust_dataset_chunk_513273
rust_dataset.txt
513,273
512
if let Some(images_to_reap) = self.sixel_grid.clear() { self.sixel_grid.reap_images(images_to_reap); } self.kitty_grid .clear_visible_placements(self.lines_above.len()); } else if clear_type == 3 ...
rust_dataset_chunk_513274
rust_dataset.txt
513,274
512
() { // reap images before dropping the alternate_screen_state contents // - we can't implement a drop method for this because the store is // outside of the alternate_screen_state struct ...
rust_dataset_chunk_513275
rust_dataset.txt
513,275
512
}, 20 => { self.new_line_mode = false; }, _ => {}, } } } } else if c == 'h' { let first_intermediate_is_questionmark = match int...
rust_dataset_chunk_513276
rust_dataset.txt
513,276
512
back_display_rows = 0; self.output_buffer.update_all_lines(); // make sure the screen gets cleared in the next render }, 1 => { self.cursor_key_mode = true; }, 3 => { ...
rust_dataset_chunk_513277
rust_dataset.txt
513,277
512
_messages_to_pty.push(response.into_bytes()); }, 2031 => { let value = if self.color_palette_notification_enabled { 1 } else { 2 ...
rust_dataset_chunk_513278
rust_dataset.txt
513,278
512
.clear_tabstop(self.cursor.x); } else if clear_type == 3 { self.clear_all_tabstops(); } } else if c == 'd' { // goto line let line = next_param_or(1).saturating_sub(1); let pad_character = EMPTY_TERMINAL_CHARACTER; self.move...
rust_dataset_chunk_513279
rust_dataset.txt
513,279
512
= format!( "\u{1b}[?2;0;{};{}S", character_cell_size.width * self.width, character_cell_size.height * self.height, ); self.pending_messages_to_pty ...
rust_dataset_chunk_513280
rust_dataset.txt
513,280
512
== 'u' { self.restore_cursor_position(); } else if c == '@' { let count = next_param_or(1); for _ in 0..count { let mut pad_character = EMPTY_TERMINAL_CHARACTER; pad_character.styles = self.cursor.pending_styles.clone(); self.a...
rust_dataset_chunk_513281
rust_dataset.txt
513,281
512
xtversion = format!("\u{1b}P>|Zellij({})\u{1b}\\", version); self.pending_messages_to_pty .push(xtversion.as_bytes().to_vec()); } } else if c == 'Z' { for _ in 0..next_param_or(1) { self.move_to_previous_tabstop(); } ...
rust_dataset_chunk_513282
rust_dataset.txt
513,282
512
// Screen recognises the variant and writes the reply // straight to the pane's pty. for param in params_iter.map(|param| param[0]) { if param == 996 { self.pending_forwarded_queries .push(crate::host_query::HostQue...
rust_dataset_chunk_513283
rust_dataset.txt
513,283
512
, not Zellij's synthesised // (cell_size * grid_size) value. The host's reply will // be written back to this pane by the forwarding // infrastructure on Screen. self.pending_forwarded_queries .push(crate::host_query...
rust_dataset_chunk_513284
rust_dataset.txt
513,284
512
Index = match charset_index_symbol { Some(b'(') => CharsetIndex::G0, Some(b')') => CharsetIndex::G1, Some(b'*') => CharsetIndex::G2, Some(b'+') => CharsetIndex::G3, _ => { // invalid, silently do ...
rust_dataset_chunk_513285
rust_dataset.txt
513,285
512
Grid, kitty_grid: KittyGrid, supports_kitty_keyboard_protocol: bool, ) -> Self { AlternateScreenState { lines_above, viewport, cursor, sixel_grid, kitty_grid, supports_kitty_keyboard_protocol, } } pub fn ...
rust_dataset_chunk_513286
rust_dataset.txt
513,286
512
Iter<'_, Osc133Marker> { self.as_slice().iter() } fn iter_mut(&mut self) -> std::slice::IterMut<'_, Osc133Marker> { match self.0.as_deref_mut() { Some(markers) => markers.iter_mut(), None => [].iter_mut(), } } fn is_empty(&self) -> bool { self.as_s...
rust_dataset_chunk_513287
rust_dataset.txt
513,287
512
, "{:?}", character)?; } for _ in 0..self.trailing_blanks { write!(f, "{:?}", EMPTY_TERMINAL_CHARACTER)?; } Ok(()) } } impl Row { pub fn new() -> Self { Row { columns: Vec::new(), osc133_markers: Osc133Markers::default(), w...
rust_dataset_chunk_513288
rust_dataset.txt
513,288
512
anks as usize } else { let mut width = 0; let mut only_single_width = true; for terminal_character in &self.columns { let character_width = terminal_character.width(); width += character_width; only_single_width &= character_wid...
rust_dataset_chunk_513289
rust_dataset.txt
513,289
512
() - 1; } } acc } pub fn excess_width_until(&self, x: usize) -> usize { let mut acc = 0; for terminal_character in self.columns.iter().take(x) { if terminal_character.width() > 1 { acc += terminal_character.width() - 1; } ...
rust_dataset_chunk_513290
rust_dataset.txt
513,290
512
1 < self.columns.len() { let removed = self.columns.remove(index + 1); covered_end += removed.width(); } for _ in target_end..covered_end { self.columns.insert(index + 1, EMPTY_TERMINAL_CHARACTER); } } self.mark_widths_c...
rust_dataset_chunk_513291
rust_dataset.txt
513,291
512
()); } } } pub fn add_character_at(&mut self, terminal_character: TerminalCharacter, x: usize) { match self.width_cached().cmp(&x) { Ordering::Equal => { self.width = encode_width(x + terminal_character.width()); self.only_single_width &= t...
rust_dataset_chunk_513292
rust_dataset.txt
513,292
512
replacing_blank = self.columns[index].character == ' '; let overwrite_start = start; let overwrite_end = covered_end.max(new_end); if !self.osc133_markers.is_empty() { self.osc133_markers.retain(|marker| { marker.column < overwrite_start || marker...
rust_dataset_chunk_513293
rust_dataset.txt
513,293
512
} self.width = None; } pub fn replace_columns(&mut self, columns: Vec<TerminalCharacter>) { self.columns = columns; self.osc133_markers.clear(); self.width = None; } pub fn push(&mut self, terminal_character: TerminalCharacter) { self.columns.push(terminal_charac...
rust_dataset_chunk_513294
rust_dataset.txt
513,294
512
_trailing_blanks(); if !to_append.osc133_markers.is_empty() { let column_offset = self.width_cached(); self.osc133_markers .extend( to_append .osc133_markers .take_all() .into_iter...
rust_dataset_chunk_513295
rust_dataset.txt
513,295
512
(); } else if to_position_accounting_for_widechars >= self.columns.len() { drop(self.columns.drain(0..to_position_accounting_for_widechars)); } else { drop(self.columns.drain(0..=to_position_accounting_for_widechars)); } replace_with.append(&mut self.columns); ...
rust_dataset_chunk_513296
rust_dataset.txt
513,296
512
mut part_lengths: Vec<usize> = Vec::new(); let mut current_part_len = 0; let mut current_part_width = 0; for row in &mut rows { for mut marker in row.osc133_markers.take_all() { marker.column += column_offset; markers.push(marker); } ...
rust_dataset_chunk_513297
rust_dataset.txt
513,297
512
_line(&self) -> usize { self.columns.len() } pub fn word_indices_around_character_index( &self, index: usize, word_separators: &str, ) -> Option<(usize, usize)> { let absolute_character_index = self.absolute_character_index(index); let character_at_index = sel...
rust_dataset_chunk_513298
rust_dataset.txt
513,298
512
None } }) .unwrap_or_else(|| self.columns.len()) } } fn is_selection_boundary_character(character: char, word_separators: &str) -> bool { character.is_ascii_whitespace() || word_separators.contains(character) } #[cfg(test)] #[path = "./unit/grid_tests.rs"] mod grid_tes...
rust_dataset_chunk_513299
rust_dataset.txt
513,299
512
", "https://", "ftp://", "mailto:"]; #[derive(Clone, Copy)] struct Cell { character: char, y: isize, index: usize, } fn row_ref<'a>( lines_above: &'a VecDeque<Row>, viewport: &'a VecDeque<Row>, y: isize, ) -> Option<&'a Row> { if y < 0 { let index = lines_above.len() as isize + y; ...