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_513400 | rust_dataset.txt | 513,400 | 512 | true;
}
}
}
}
false
}
fn reset_logical_position(&mut self) {
self.geom.logical_position = None;
}
fn mouse_event(&self, event: &MouseEvent, client_id: ClientId) -> Option<String> {
match event.event_type {
Mouse... |
rust_dataset_chunk_513401 | rust_dataset.txt | 513,401 | 512 | _render(true);
}
fn set_client_should_render(&mut self, client_id: ClientId, should_render: bool) {
self.should_render.insert(client_id, should_render);
}
fn handle_plugin_bytes_for_all_clients(&mut self, bytes: VteBytes) {
let client_ids: Vec<ClientId> = self.grids.keys().copied().colle... |
rust_dataset_chunk_513402 | rust_dataset.txt | 513,402 | 512 | >= min_row_count {
messages.push_str(&format!(
"{} {} {}\n",
bold_white.paint("Plugin"),
cyan.paint(&plugin_permission.name),
bold_white.paint("asks permission to:"),
));
permissions.iter().enumerate().for_each(|(i, p)|... |
rust_dataset_chunk_513403 | rust_dataset.txt | 513,403 | 512 | one() {
let mut pane = plugin_pane(vec![1]);
pane.handle_plugin_bytes(1, b"about screen".to_vec());
pane.start_loading_indication_for_client(2, LoadingIndication::new("plugin".to_owned()));
pane.progress_animation_offset();
assert!(shown_to(&pane, 1).contains("about screen"));
... |
rust_dataset_chunk_513404 | rust_dataset.txt | 513,404 | 512 | , tail: &[&Row]) -> Self {
let mut text = String::new();
let mut cells = Vec::new();
for (offset, current) in std::iter::once(row).chain(tail.iter().copied()).enumerate() {
let mut column = 0;
for cell in ¤t.columns {
cells.push(HaystackCell {
... |
rust_dataset_chunk_513405 | rust_dataset.txt | 513,405 | 512 | _word_only: bool, // TODO
// Jump from the bottom to the top (or vice versa), if we run out of lines to search
pub wrap_search: bool,
}
impl SearchResult {
/// This is only used for Debug formatting Grid, which itself is only used
/// for tests.
#[allow(clippy::ptr_arg)]
pub(crate) fn mark_sear... |
rust_dataset_chunk_513406 | rust_dataset.txt | 513,406 | 512 | = FoldedText {
text: String::new(),
original_starts: Vec::new(),
};
(original, self.needle.as_str())
};
if needle.is_empty() {
return found;
}
let mut position = 0;
while position <= search_text.len() {
... |
rust_dataset_chunk_513407 | rust_dataset.txt | 513,407 | 512 | (&haystack) {
let (Some(first), Some(last)) = (
haystack.cell_containing(start),
haystack.cell_containing(end - 1),
) else {
continue;
};
if first.row != ridx {
continue;
}
let mut sel... |
rust_dataset_chunk_513408 | rust_dataset.txt | 513,408 | 512 | .len() && !viewport[tail_idx].is_canonical {
tail.push(&viewport[tail_idx]);
} else {
break;
}
}
let selections = self.search_row(0, row, &tail);
for selection in selections.iter().rev... |
rust_dataset_chunk_513409 | rust_dataset.txt | 513,409 | 512 | .selections {
self.output_buffer
.update_lines(res.start.line() as usize, res.end.line() as usize);
}
self.search_results = Default::default();
}
pub fn set_search_string(&mut self, needle: &str) {
self.search_results.needle = needle.to_string();
self... |
rust_dataset_chunk_513410 | rust_dataset.txt | 513,410 | 512 | _word_only;
for line in self.search_results.selections.drain(..) {
self.output_buffer
.update_lines(line.start.line() as usize, line.end.line() as usize);
}
self.search_results.active = None;
self.search_viewport();
// Maybe the selection we had is now... |
rust_dataset_chunk_513411 | rust_dataset.txt | 513,411 | 512 | _active_selection_to_prev(),
SearchDirection::Down => self.search_results.move_active_selection_to_next(),
};
if let Some(new_active) = self.search_results.active {
self.output_buffer.update_lines(
new_active.start.line() as usize,
... |
rust_dataset_chunk_513412 | rust_dataset.txt | 513,412 | 512 | search_viewport_wrap(&mut self, dir: SearchDirection) {
// We might loose the current selection, if we can't find anything
let current_active_selection = self.search_results.active;
// UP
// Go to the opposite end (bottom when searching up and top when searching down)
let mut ro... |
rust_dataset_chunk_513413 | rust_dataset.txt | 513,413 | 512 | --- FILE: zellij/zellij-server/src/panes/selection.rs ---
use std::{collections::HashSet, ops::Range};
use zellij_utils::position::Position;
// The selection is empty when start == end
// it includes the character at start, and everything before end.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Selection {... |
rust_dataset_chunk_513414 | rust_dataset.txt | 513,414 | 512 | _is_below_last_added_word = self
.last_added_word_position
.map(|(_l_start, l_end)| word_end.line > l_end.line)
.unwrap_or(false);
if word_is_above_last_added_word && word_start.line < self.start.line {
// extend line above
self.start = word_start;
... |
rust_dataset_chunk_513415 | rust_dataset.txt | 513,415 | 512 | _of_word_end
&& selection_end_is_on_same_line_as_word_end
{
// extend selection right
self.end.column = word_end.column;
} else if last_word_start_equals_word_end {
// reduce selection from the right
self.end.column ... |
rust_dataset_chunk_513416 | rust_dataset.txt | 513,416 | 512 | if self.start <= self.end {
(self.start, self.end)
} else {
(self.end, self.start)
};
if (start.line.0) < row && row < end.line.0 {
return true;
}
if start.line == end.line {
return row == start.line.0 && start.column.0 <= col && ... |
rust_dataset_chunk_513417 | rust_dataset.txt | 513,417 | 512 | self.end.line.0 += offset_y as isize;
self.start.column.0 += offset_x;
self.end.column.0 += offset_x;
self
}
/// Return an iterator over the line indices, up to max, that are not present in both self and other,
/// except for the indices of the first and last line of both self and ... |
rust_dataset_chunk_513418 | rust_dataset.txt | 513,418 | 512 | fn new(x: usize, y: usize, height: usize, width: usize) -> Self {
PixelRect {
x,
y: y as isize,
width,
height,
}
}
pub fn intersecting_rect(&self, other: &PixelRect) -> Option<PixelRect> {
// if the two rects intersect, this returns a Pixe... |
rust_dataset_chunk_513419 | rust_dataset.txt | 513,419 | 512 | , Copy, Default)]
struct SixelSizeBudget {
cursor_x: usize,
cursor_y: usize,
width: usize,
height: usize,
max_height: Option<usize>,
}
impl SixelSizeBudget {
fn new(max_height: Option<usize>) -> Self {
SixelSizeBudget {
max_height,
..Default::default()
}
... |
rust_dataset_chunk_513420 | rust_dataset.txt | 513,420 | 512 | _cell_size = *character_cell_size.borrow();
SixelGrid {
previous_cell_size,
character_cell_size,
sixel_image_store,
..Default::default()
}
}
pub fn handle_byte(&mut self, byte: u8) {
let currently_parsing = &mut self.currently_parsing;
... |
rust_dataset_chunk_513421 | rust_dataset.txt | 513,421 | 512 |
for (i, param) in dcs_params.iter().enumerate() {
if i != 0 {
self.handle_byte(b';');
}
for subparam in param.iter() {
let mut b = [0; 4];
for digit in subparam.to_string().chars() {
let len = digit.encode_u... |
rust_dataset_chunk_513422 | rust_dataset.txt | 513,422 | 512 | iter()
.map(|(image_id, pixel_rect)| (*image_id, pixel_rect))
}
pub fn has_images(&self) -> bool {
!self.sixel_image_locations.is_empty()
}
pub fn cut_off_rect_from_images(
&mut self,
rect_to_cut_out: PixelRect,
) -> Option<Vec<(usize, PixelRect)>> {
// if... |
rust_dataset_chunk_513423 | rust_dataset.txt | 513,423 | 512 | None
}
}
pub fn character_cell_size_possibly_changed(&mut self) {
if let (Some(previous_cell_size), Some(character_cell_size)) =
(self.previous_cell_size, *self.character_cell_size.borrow())
{
if previous_cell_size != character_cell_size {
... |
rust_dataset_chunk_513424 | rust_dataset.txt | 513,424 | 512 | _check_for_emptiness.insert(image_id);
}
pub fn reap_images(&mut self, ids_to_reap: Vec<usize>) {
for id in ids_to_reap {
drop(self.sixel_image_store.borrow_mut().sixel_images.remove(&id));
}
}
pub fn image_cell_coordinates_in_viewport(
&self,
viewport_height:... |
rust_dataset_chunk_513425 | rust_dataset.txt | 513,425 | 512 | viewport_x_offset: usize,
viewport_y_offset: usize,
) -> Vec<SixelImageChunk> {
let mut changed_sixel_image_chunks = vec![];
if let Some(character_cell_size) = { *self.character_cell_size.borrow() } {
for (sixel_image_id, sixel_image_pixel_rect) in self.image_coordinates(... |
rust_dataset_chunk_513426 | rust_dataset.txt | 513,426 | 512 | ::cmp::min(changed_rect_bottom_edge, sixel_image_bottom_edge)
- std::cmp::max(changed_rect_top_edge, sixel_image_top_edge))
as usize,
sixel_image_pixel_rect.height,
);
if (sixel_image_top_edge >= cha... |
rust_dataset_chunk_513427 | rust_dataset.txt | 513,427 | 512 | ::From;
use std::fmt::{self, Debug, Display, Formatter};
use std::ops::{Index, IndexMut};
use std::rc::Rc;
use unicode_width::UnicodeWidthChar;
use crate::vt_parser::ParameterGroups;
use unicode_width::UnicodeWidthStr;
use zellij_utils::data::StyleDeclaration;
use zellij_utils::data::{PaletteColor, Style};
use zellij_... |
rust_dataset_chunk_513428 | rust_dataset.txt | 513,428 | 512 | , Debug, PartialEq, Eq)]
pub enum AnsiCode {
On,
Reset,
NamedColor(NamedColor),
RgbCode((u8, u8, u8)),
ColorIndex(u8),
Underline(Option<AnsiStyledUnderline>),
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AnsiStyledUnderline {
Double,
Undercurl,
Underdotted,
Underdashe... |
rust_dataset_chunk_513429 | rust_dataset.txt | 513,429 | 512 | Color::Cyan => 46,
NamedColor::White => 47,
NamedColor::BrightBlack => 100,
NamedColor::BrightRed => 101,
NamedColor::BrightGreen => 102,
NamedColor::BrightYellow => 103,
NamedColor::BrightBlue => 104,
NamedColor::BrightMagenta => 105,
... |
rust_dataset_chunk_513430 | rust_dataset.txt | 513,430 | 512 | mut styles);
if styles.is_identical_to(self) {
return;
}
*self = style_cache.share(styles);
}
pub fn ptr_eq(&self, other: &RcCharacterStyles) -> bool {
match (self, other) {
(RcCharacterStyles::Reset, RcCharacterStyles::Reset) => true,
(RcChar... |
rust_dataset_chunk_513431 | rust_dataset.txt | 513,431 | 512 | 8])),
u64::from_le_bytes(high.try_into().unwrap_or([0; 8])),
],
})
}
}
#[derive(Debug, Clone)]
struct SgrMemo {
input: RcCharacterStyles,
key: SgrKey,
output: RcCharacterStyles,
}
fn styles_address(styles: &RcCharacterStyles) -> usize {
match styles {
R... |
rust_dataset_chunk_513432 | rust_dataset.txt | 513,432 | 512 | siCode::Underline(Some(style))) => 7 | (style as u64) << 8,
}
}
fn style_fingerprint(styles: &CharacterStyles) -> u64 {
code_key(styles.foreground)
^ code_key(styles.background).rotate_left(32)
^ code_key(styles.bold).rotate_left(5)
^ code_key(styles.underline).rotate_left(13)
}
impl S... |
rust_dataset_chunk_513433 | rust_dataset.txt | 513,433 | 512 | if styles == RESET_STYLES {
return RcCharacterStyles::Reset;
}
let fingerprint = style_fingerprint(&styles);
let first = (fingerprint.wrapping_mul(0x9E37_79B9_7F4A_7C15) >> 40) as usize
% SHARED_STYLE_SLOTS
& !1;
for slot in [first, first + 1] ... |
rust_dataset_chunk_513434 | rust_dataset.txt | 513,434 | 512 | .strike == other.strike
&& self.hidden == other.hidden
&& self.reverse == other.reverse
&& self.slow_blink == other.slow_blink
&& self.fast_blink == other.fast_blink
&& self.underline == other.underline
&& self.bold == other.bold
&& sel... |
rust_dataset_chunk_513435 | rust_dataset.txt | 513,435 | 512 | strike_code: Option<AnsiCode>) -> Self {
self.strike = strike_code;
self
}
pub fn link_anchor(mut self, link_anchor: Option<LinkAnchor>) -> Self {
self.link_anchor = link_anchor;
self
}
pub fn enable_styled_underlines(mut self, enabled: bool) -> Self {
self.style... |
rust_dataset_chunk_513436 | rust_dataset.txt | 513,436 | 512 | = new_styles.fast_blink;
}
if self.underline != new_styles.underline {
diff.underline = new_styles.underline;
}
if self.bold != new_styles.bold {
diff.bold = new_styles.bold;
}
if self.dim != new_styles.dim {
diff.dim = new_styles.dim;... |
rust_dataset_chunk_513437 | rust_dataset.txt | 513,437 | 512 | (Some(AnsiCode::On)),
[3] => *self = self.italic(Some(AnsiCode::On)),
[4, 0] => *self = self.underline(Some(AnsiCode::Reset)),
[4, 1] => *self = self.underline(Some(AnsiCode::Underline(None))),
[4, 2] => {
*self =
... |
rust_dataset_chunk_513438 | rust_dataset.txt | 513,438 | 512 | Code::Reset)),
[29] => *self = self.strike(Some(AnsiCode::Reset)),
[30] => *self = self.foreground(Some(AnsiCode::NamedColor(NamedColor::Black))),
[31] => *self = self.foreground(Some(AnsiCode::NamedColor(NamedColor::Red))),
[32] => *self = self.foreground... |
rust_dataset_chunk_513439 | rust_dataset.txt | 513,439 | 512 | amedColor::Blue))),
[45] => *self = self.background(Some(AnsiCode::NamedColor(NamedColor::Magenta))),
[46] => *self = self.background(Some(AnsiCode::NamedColor(NamedColor::Cyan))),
[47] => *self = self.background(Some(AnsiCode::NamedColor(NamedColor::White))),
... |
rust_dataset_chunk_513440 | rust_dataset.txt | 513,440 | 512 | ] => {
*self = self.foreground(Some(AnsiCode::NamedColor(NamedColor::BrightYellow)))
},
[94] => *self = self.foreground(Some(AnsiCode::NamedColor(NamedColor::BrightBlue))),
[95] => {
*self = self.foreground(Some(AnsiCode::NamedColor... |
rust_dataset_chunk_513441 | rust_dataset.txt | 513,441 | 512 | .slow_blink == Some(AnsiCode::Reset)
&& self.underline == Some(AnsiCode::Reset)
&& self.bold == Some(AnsiCode::Reset)
&& self.dim == Some(AnsiCode::Reset)
&& self.italic == Some(AnsiCode::Reset)
{
write!(f, "\u{1b}[m")?; // reset all
return... |
rust_dataset_chunk_513442 | rust_dataset.txt | 513,442 | 512 | !(f, "\u{1b}[58:5:{}m", color_index)?;
},
AnsiCode::Reset => {
write!(f, "\u{1b}[59m")?;
},
_ => {},
}
};
}
if let Some(ansi_code) = self.strike {
match ansi_co... |
rust_dataset_chunk_513443 | rust_dataset.txt | 513,443 | 512 | AnsiCode::Underline(Some(styled)) => {
if self.styled_underlines_enabled {
match styled {
AnsiStyledUnderline::Double => {
write!(f, "\u{1b}[4:2m")?;
},
... |
rust_dataset_chunk_513444 | rust_dataset.txt | 513,444 | 512 | StandardCharset {
Ascii,
UK,
SpecialCharacterAndLineDrawing,
}
impl Default for StandardCharset {
fn default() -> Self {
StandardCharset::Ascii
}
}
impl StandardCharset {
/// Switch/Map character to the active charset. Ascii is the common case and
/// for that we want to do as lit... |
rust_dataset_chunk_513445 | rust_dataset.txt | 513,445 | 512 | _mut(&mut self, index: CharsetIndex) -> &mut StandardCharset {
&mut self.0[index as usize]
}
}
#[derive(Clone, Copy, Debug)]
pub enum CursorShape {
Initial,
Block,
BlinkingBlock,
Underline,
BlinkingUnderline,
Beam,
BlinkingBeam,
}
impl CursorShape {
pub fn get_csi_str(&self... |
rust_dataset_chunk_513446 | rust_dataset.txt | 513,446 | 512 | scalar value
// (fits, since code points need at most 21 bits)
// bit 31 (EXTRA_TAG) set two or more attached code points; bits 8..31 are an id
// into `cluster_table`, which holds their text and a
// reference... |
rust_dataset_chunk_513447 | rust_dataset.txt | 513,447 | 512 | self.packed = width as u32;
}
#[inline]
pub fn new(character: char) -> Self {
Self::new_styled(character, Default::default())
}
#[inline]
pub fn new_styled(character: char, styles: RcCharacterStyles) -> Self {
TerminalCharacter {
character,
styles,
... |
rust_dataset_chunk_513448 | rust_dataset.txt | 513,448 | 512 | ) -> Self {
TerminalCharacter {
character,
styles,
packed: 1,
}
}
#[inline]
pub fn width(&self) -> usize {
(self.packed & 0xff) as usize
}
pub(crate) fn set_width(&mut self, width: u8) {
self.packed = (self.packed & !0xff) | width... |
rust_dataset_chunk_513449 | rust_dataset.txt | 513,449 | 512 | false;
}
let mut text = ArrayString::<{ MAX_CODE_POINTS_PER_CELL * 4 }>::new();
if text.try_push_str(&existing).is_err() || text.try_push(c).is_err() {
return false;
}
match cluster_table::intern(&text) {
... |
rust_dataset_chunk_513450 | rust_dataset.txt | 513,450 | 512 | return Cow::Owned(buf);
}
let mut out = String::new();
self.push_text_to(&mut out);
Cow::Owned(out)
}
pub fn utf8_len(&self) -> usize {
if !self.has_attached() {
return self.character.len_utf8();
}
let mut len = 0;
self.for_each_char(... |
rust_dataset_chunk_513451 | rust_dataset.txt | 513,451 | 512 | command_color_text,
command_text,
RESET_STYLES
);
let controls_bare_text_first_part = "<";
let enter_bare_text = "ENTER";
let controls_bare_text_second_part = "> run, <";
let esc_bare_text = "ESC";
let controls_bar... |
rust_dataset_chunk_513452 | rust_dataset.txt | 513,452 | 512 | bold_text, bare_text, RESET_STYLES
);
let controls_bare_text_first_part = "<";
let enter_bare_text = "ENTER";
let controls_bare_text_second_part = "> run, <";
let esc_bare_text = "ESC";
let controls_bare_text_third_part = "> drop to shell, <";
... |
rust_dataset_chunk_513453 | rust_dataset.txt | 513,453 | 512 | grid::{Grid, PendingNotification},
nested_session_modal::GuestModalShortcuts,
terminal_character::{render_first_run_banner, TerminalCharacter, EMPTY_TERMINAL_CHARACTER},
};
use crate::pty::VteBytes;
use crate::route::NotificationEnd;
use crate::tab::{AdjustedInput, GuestChoiceIndicator, Pane};
use crate::vt... |
rust_dataset_chunk_513454 | rust_dataset.txt | 513,454 | 512 | : &[u8] = &[13];
const SPACE: &[u8] = &[32];
const CTRL_C: &[u8] = &[3]; // TODO: check this to be sure it fits all types of CTRL_C (with mac, etc)
const TERMINATING_STRING: &str = "\0";
const DELETE_KEY: &str = "\u{007F}";
const BACKSPACE_KEY: &str = "\u{0008}";
/// The ansi encoding of some keys
#[derive(Debug, Clon... |
rust_dataset_chunk_513455 | rust_dataset.txt | 513,455 | 512 | Id::Plugin(id),
}
}
}
impl std::fmt::Display for PaneId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
PaneId::Terminal(id) => write!(f, "terminal_{}", id),
PaneId::Plugin(id) => write!(f, "plugin_{}", id),
}
}
}
type IsF... |
rust_dataset_chunk_513456 | rust_dataset.txt | 513,456 | 512 | `true` while a host-terminal forward initiated by this pane is
/// outstanding. While set, processing of `pending_pty_input` is
/// suspended so that the async host reply lands on the pane's
/// stdin in the same stream position the original query occupied.
/// Cleared by Tab when the reply (or 500 ms ... |
rust_dataset_chunk_513457 | rust_dataset.txt | 513,457 | 512 | aturating_sub(self.content_offset.top + self.content_offset.bottom)
}
fn reset_size_and_position_override(&mut self) {
self.geom_override = None;
self.reflow_lines();
}
fn set_geom(&mut self, position_and_size: PaneGeom) {
let is_pinned = self.geom.is_pinned;
self.geom = ... |
rust_dataset_chunk_513458 | rust_dataset.txt | 513,458 | 512 | 0 {
capture_started = false;
forwarded.extend_from_slice(&rest[..run]);
index += run;
continue;
}
}
let byte = bytes[index];
index += 1;
match self.kitty_interceptor.advance(by... |
rust_dataset_chunk_513459 | rust_dataset.txt | 513,459 | 512 | , client_id: Option<ClientId>) -> Option<(usize, usize, bool)> {
// (x, y, is_visible)
if let Some(client_id) = client_id {
if self.guest_modal.contains_key(&client_id) {
return None;
}
}
if self.get_content_rows() < 1 || self.get_content_columns()... |
rust_dataset_chunk_513460 | rust_dataset.txt | 513,460 | 512 | _modifier(BareKey::Up)
|| k.is_key_without_modifier(BareKey::Char('k'))
})
.unwrap_or(false)
|| raw_input_bytes.as_slice() == UP_ARROW;
let is_down = key_with_modifier
.as_ref()
.map(|k| {
... |
rust_dataset_chunk_513461 | rust_dataset.txt | 513,461 | 512 | None
}
} else if self.is_held.is_some() {
if key_with_modifier
.as_ref()
.map(|k| k.is_key_without_modifier(BareKey::Enter))
.unwrap_or(false)
{
self.handle_held_run()
} else if key_with_modifier
... |
rust_dataset_chunk_513462 | rust_dataset.txt | 513,462 | 512 | : bool) {
self.selectable = selectable;
}
fn set_pane_default_colors(&mut self, fg: Option<String>, bg: Option<String>) {
self.grid.set_pane_default_colors(fg, bg);
self.set_should_render(true);
}
fn get_pane_default_colors(&self) -> (Option<String>, Option<String>) {
sel... |
rust_dataset_chunk_513463 | rust_dataset.txt | 513,463 | 512 | from("Enter name...")
} else if input_mode == InputMode::EnterSearch
&& frame_params.is_main_client
&& self.search_term.is_empty()
{
String::from("Enter search...")
} else if (input_mode == InputMode::EnterSearch || input_mode == InputMode::Search)
... |
rust_dataset_chunk_513464 | rust_dataset.txt | 513,464 | 512 | } else {
frame.add_exit_status(exit_status.as_ref().copied());
}
}
if let Some((frame_color_override, _text)) = self.pane_frame_color_override.as_ref() {
frame.override_color(*frame_color_override);
}
let res = match self.frame.get(&client_id) {
... |
rust_dataset_chunk_513465 | rust_dataset.txt | 513,465 | 512 | self, name: &str) {
match name {
TERMINATING_STRING => {
self.pane_name = String::new();
},
DELETE_KEY | BACKSPACE_KEY => {
zellij_utils::graphemes::pop_cluster(&mut self.pane_name);
},
c => {
self.pane_... |
rust_dataset_chunk_513466 | rust_dataset.txt | 513,466 | 512 | (String, Option<usize>) {
self.grid.preview_with_anchor(anchor, max_scrollback)
}
fn program_resized_at(&self) -> Option<Instant> {
self.program_resized_at
}
fn mark_unseen_output_start(&mut self) {
self.grid.mark_unseen_output_start();
}
fn clear_screen(&mut self) {
... |
rust_dataset_chunk_513467 | rust_dataset.txt | 513,467 | 512 | ().get_csi_str().to_string()
}
fn drain_messages_to_pty(&mut self) -> Vec<Vec<u8>> {
self.grid.pending_messages_to_pty.drain(..).collect()
}
fn drain_forwarded_queries(&mut self) -> Vec<crate::host_query::HostQuery> {
self.grid.pending_forwarded_queries.drain(..).collect()
}
fn... |
rust_dataset_chunk_513468 | rust_dataset.txt | 513,468 | 512 | }
self.set_should_render(true);
true
}
fn has_guest_modal_for_any_client(&self) -> bool {
!self.guest_modal.is_empty()
}
fn set_guest_choice_indicator(
&mut self,
client_id: ClientId,
indicator: Option<GuestChoiceIndicator>,
) {
let previous... |
rust_dataset_chunk_513469 | rust_dataset.txt | 513,469 | 512 | _clipboard_update.take()
}
fn drain_desktop_notifications(&mut self) -> Vec<PendingNotification> {
self.grid.pending_desktop_notifications.drain(..).collect()
}
fn drain_osc7_cwd(&mut self) -> Option<std::path::PathBuf> {
self.grid.pending_osc7_cwd.take()
}
fn drain_prompt_ret... |
rust_dataset_chunk_513470 | rust_dataset.txt | 513,470 | 512 | _id: Option<ClientId>) {
self.grid.reset_selection();
}
fn get_selected_text(&self, _client_id: ClientId) -> Option<String> {
self.grid.get_selected_text()
}
fn set_frame(&mut self, _frame: bool) {
self.frame.clear();
}
fn set_content_offset(&mut self, offset: Offset) ... |
rust_dataset_chunk_513471 | rust_dataset.txt | 513,471 | 512 | <String> {
self.grid.mouse_right_click_signal(position, is_held)
}
fn mouse_right_click_release(&self, position: &Position) -> Option<String> {
self.grid.mouse_right_click_release_signal(position)
}
fn mouse_middle_click(&self, position: &Position, is_held: bool) -> Option<String> {
... |
rust_dataset_chunk_513472 | rust_dataset.txt | 513,472 | 512 | No-op
}
self.grid.search_up();
self.set_should_render(true);
}
fn toggle_search_case_sensitivity(&mut self) {
self.grid.toggle_search_case_sensitivity();
self.set_should_render(true);
}
fn toggle_search_whole_words(&mut self) {
self.grid.toggle_search_who... |
rust_dataset_chunk_513473 | rust_dataset.txt | 513,473 | 512 | Id>,
) {
// TODO: if we have a client_id, we should only highlight the frame for this client
self.pane_frame_color_override = Some((self.style.colors.frame_highlight.emphasis_0, text));
}
fn clear_pane_frame_color_override(&mut self, _client_id: Option<ClientId>) {
// TODO: if we hav... |
rust_dataset_chunk_513474 | rust_dataset.txt | 513,474 | 512 | mut self) -> Vec<crate::attention::PaneSignal> {
self.grid.shell_reports.drain()
}
fn set_initial_attention_flags(&mut self, muted: bool, ignore_output: bool) {
self.initial_attention_flags = Some((muted, ignore_output));
}
fn take_initial_attention_flags(&mut self) -> Option<(bool, bool... |
rust_dataset_chunk_513475 | rust_dataset.txt | 513,475 | 512 | self.remove_banner();
run_command.clone()
})
}
fn update_theme(&mut self, theme: Styling) {
self.style.colors = theme.clone();
self.grid.update_theme(theme);
if self.banner.is_some() {
// we do this so that the banner will be updated with the new theme co... |
rust_dataset_chunk_513476 | rust_dataset.txt | 513,476 | 512 | false
}
fn position_is_on_pin_button(&self, position: &Position, client_id: ClientId) -> bool {
if self.position_is_on_frame(position) {
let relative_position = self.relative_position(position);
if let Some(client_frame) = self.frame.get(&client_id) {
retu... |
rust_dataset_chunk_513477 | rust_dataset.txt | 513,477 | 512 | fn clear_plugin_highlights(&mut self, plugin_id: u32) {
self.grid.clear_plugin_highlights(plugin_id);
self.set_should_render(true);
}
fn set_hover_position(&mut self, position: Option<Position>) -> bool {
let changed = self.grid.set_hover_position(position);
if changed {
... |
rust_dataset_chunk_513478 | rust_dataset.txt | 513,478 | 512 | !("{} [!]", title)
} else {
title
}
}
fn attention_marker_text(&self) -> Option<String> {
let marker = self.attention_marker.as_ref()?;
let symbol = if marker.muted {
if self.arrow_fonts {
"⊘"
} else {
"-"
... |
rust_dataset_chunk_513479 | rust_dataset.txt | 513,479 | 512 | _end: Option<NotificationEnd>,
) -> TerminalPane {
let initial_pane_title =
initial_pane_title.unwrap_or_else(|| format!("Pane #{}", pane_index));
let grid = Grid::new(
position_and_size.rows.as_usize(),
position_and_size.cols.as_usize(),
terminal_emul... |
rust_dataset_chunk_513480 | rust_dataset.txt | 513,480 | 512 | }
pub fn get_y(&self) -> usize {
match self.geom_override {
Some(position_and_size_override) => position_and_size_override.y,
None => self.geom.y,
}
}
pub fn get_columns(&self) -> usize {
match self.geom_override {
Some(position_and_size_overri... |
rust_dataset_chunk_513481 | rust_dataset.txt | 513,481 | 512 | _content_y(),
self.get_content_columns(),
self.get_content_rows(),
self.grid.width,
self.grid.height,
full_redraw,
)
}
fn render_first_run_banner(&mut self) {
let columns = self.get_content_columns();
let rows = self.get_content... |
rust_dataset_chunk_513482 | rust_dataset.txt | 513,482 | 512 | (AdjustedInput::WriteBytesToTerminal(
"\u{0d}\u{0a}".as_bytes().to_vec(),
));
};
}
if self.grid.cursor_key_mode {
let key_is_left_arrow = raw_input_bytes.as_slice() == LEFT_ARROW
|| key
.as_ref()
... |
rust_dataset_chunk_513483 | rust_dataset.txt | 513,483 | 512 | Terminal(
AnsiEncoding::End.as_vec_bytes(),
));
}
}
if raw_input_bytes_are_kitty {
// here what happens is that the host terminal is operating in "kitty keys" mode, but
// this terminal pane is not - so we need to serialize the kitt... |
rust_dataset_chunk_513484 | rust_dataset.txt | 513,484 | 512 | _width += character.width();
kept += 1;
}
if kept < chunk.terminal_characters.len() {
chunk.terminal_characters.truncate(kept);
for _ in kept_width..available {
chunk.terminal_characters.push(EMPTY_TERMINAL_CHARACTER);
}
}
c... |
rust_dataset_chunk_513485 | rust_dataset.txt | 513,485 | 512 | ling,
},
errors::prelude::*,
input::{
command::RunCommand,
layout::{Run, RunPluginOrAlias, SplitDirection},
options::PaneFrameStyle,
},
pane_size::{Offset, PaneGeom, Size, SizeInPixels, Viewport},
};
use std::{
cell::RefCell,
collections::{BTreeMap, HashMap, HashSet}... |
rust_dataset_chunk_513486 | rust_dataset.txt | 513,486 | 512 | Senders,
window_title: Option<String>,
client_id_to_boundaries: HashMap<ClientId, Boundaries>,
tombstones_before_increase: Option<(PaneId, Vec<HashMap<PaneId, PaneGeom>>)>,
tombstones_before_decrease: Option<(PaneId, Vec<HashMap<PaneId, PaneGeom>>)>,
dimmed_clients: HashSet<ClientId>,
panes_with... |
rust_dataset_chunk_513487 | rust_dataset.txt | 513,487 | 512 | (),
panes_with_logged_render_errors: HashSet::new(),
}
}
pub fn set_client_dimmed(&mut self, client_id: ClientId, dimmed: bool) {
if dimmed {
self.dimmed_clients.insert(client_id);
} else {
self.dimmed_clients.remove(&client_id);
}
self... |
rust_dataset_chunk_513488 | rust_dataset.txt | 513,488 | 512 | pane that actually carries it.
if self.fullscreen_is_active == Some(pane_id) {
self.fullscreen_is_active = Some(with_pane_id);
}
self.panes_to_hide
.replace_beneath_fullscreen(&pane_id, with_pane_id);
self.move_clients_between_panes(pane_id, with_pane_id);
... |
rust_dataset_chunk_513489 | rust_dataset.txt | 513,489 | 512 | self.panes_to_hide,
*self.display_area.borrow(),
*self.viewport.borrow(),
);
pane_grid.room_left_in_stack_of_pane_id(pane_id)
}
pub fn assign_geom_for_pane_with_run(&mut self, run: Option<Run>) {
// here we're removing the first pane we find with this run instruc... |
rust_dataset_chunk_513490 | rust_dataset.txt | 513,490 | 512 | anes.is_empty() {
self.panes.insert(pane_id, pane);
return None;
}
let stacked_resize = { *self.stacked_resize.borrow() };
if let Some(client_id) = client_id {
if stacked_resize && self.is_connected(&client_id) {
return self.add_pane_with_stac... |
rust_dataset_chunk_513491 | rust_dataset.txt | 513,491 | 512 | },
},
}
}
fn add_pane_with_stacked_resize(
&mut self,
pane_id: PaneId,
mut pane: Box<dyn Pane>,
should_relayout: bool,
client_id: ClientId,
) -> Option<Box<dyn Pane>> {
let cursor_height_width_ratio = self.cursor_height_widt... |
rust_dataset_chunk_513492 | rust_dataset.txt | 513,492 | 512 | ::error!("Failed to split pane {:?}", pane_id_to_split);
Some(pane)
},
}
},
None => {
let newly_stacked = pane_grid.make_pane_stacked(active_pane_id).is_ok();
match pane_grid.make_room_in_stack_of_pane_id... |
rust_dataset_chunk_513493 | rust_dataset.txt | 513,493 | 512 | _pane_id: PaneId,
) -> Option<Box<dyn Pane>> {
let mut pane_grid = TiledPaneGrid::new(
&mut self.panes,
&self.panes_to_hide,
*self.display_area.borrow(),
*self.viewport.borrow(),
);
let pane_id_is_stacked = pane_grid
.get_pane_geom(... |
rust_dataset_chunk_513494 | rust_dataset.txt | 513,494 | 512 | out of the viewport just like a non-selectable pane - we cannot
// rely on selectability alone here, because a plugin only reports it once it has
// loaded, and until then we'd be calculating (and sending to the pty) wrong sizes
// for the other panes in this tab
... |
rust_dataset_chunk_513495 | rust_dataset.txt | 513,495 | 512 | (),
*self.viewport.borrow(),
);
match direction {
SplitDirection::Horizontal => {
pane_grid.layout(direction, (*self.display_area.borrow()).cols)
},
SplitDirection::Vertical => {
pane_grid.layout(direction, (*self.display_ar... |
rust_dataset_chunk_513496 | rust_dataset.txt | 513,496 | 512 | } else {
self.reserved_top_rows.borrow().clone()
};
for pane in self.panes.values_mut() {
if no_ui_fullscreen_pane_id == Some(pane.pid()) {
pane.set_frame(false);
pane.set_content_offset(Offset::default());
resize_pty!(pane,... |
rust_dataset_chunk_513497 | rust_dataset.txt | 513,497 | 512 | _columns_offset, pane_rows_offset) =
pane_content_offset(&position_and_size, pane_viewport);
let reserve_title_row = if draws_titles {
!pane_is_borderless && !single_selectable_tiled_pane && !is_one_liner_in_stack
} else {
is_st... |
rust_dataset_chunk_513498 | rust_dataset.txt | 513,498 | 512 | Some(active_pane_id) => self.can_split_pane_id_vertically(active_pane_id),
None => false,
}
}
pub fn can_split_pane_id_vertically(&mut self, active_pane_id: PaneId) -> bool {
if let Some(active_pane) = self.panes.get_mut(&active_pane_id) {
let mut full_pane_si... |
rust_dataset_chunk_513499 | rust_dataset.txt | 513,499 | 512 | active_pane_id)
{
Some(position_and_size_of_stack) => {
full_pane_size = position_and_size_of_stack;
},
None => {
log::error!("Failed to find position and size of stack");
},
}
}
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.