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_511100 | rust_dataset.txt | 511,100 | 512 | content_width, now, simplified_ui).style(&item);
if self.card_hovered == Some(CardTarget::Item(key.clone())) {
text = text.selected();
}
print_text_with_coordinates(text, content_x, y, Some(content_width), None);
self.card_targets
.push((y... |
rust_dataset_chunk_511101 | rust_dataset.txt | 511,101 | 512 | }
print_text_with_coordinates(open_text, open_x, footer_y, Some(open.width()), None);
self.card_targets.push((
footer_y,
open_x..open_x + open.width(),
CardTarget::OpenInbox,
));
let bottom_y = footer_y + 1;
for side_y in 1..bottom_y {
... |
rust_dataset_chunk_511102 | rust_dataset.txt | 511,102 | 512 | _status();
let range = at..at + 1;
if item.is_muted() {
text.dim_range(range)
} else if status.is_idle() && item.item.attention.watched {
text.color_range(WATCHING_EMPHASIS, range)
} else {
style_status(text, status, range)
}
}
fn style_symbol(text: Text, item: &GlobalAttent... |
rust_dataset_chunk_511103 | rust_dataset.txt | 511,103 | 512 | _status(text, AttentionStatus::NeedsYou, range),
Section::Failed => style_status(text, AttentionStatus::Failed, range),
Section::Done => style_status(text, AttentionStatus::Done, range),
Section::Working => text,
_ => text.dim_range(range),
}
}
}
fn session_n... |
rust_dataset_chunk_511104 | rust_dataset.txt | 511,104 | 512 | .color_range(SESSION_EMPHASIS, 0..name_end)
.dim_range(name_end..total)
},
}
}
fn section_heading(section: Section, count: usize, width: usize) -> Text {
let title = if section == Section::Working {
format!("{} {}", section.title(), spinner_frame(now_ms()))
}... |
rust_dataset_chunk_511105 | rust_dataset.txt | 511,105 | 512 | pane = truncate_middle(&pane, pane_room);
PaneRowParts {
session,
head,
pane,
tail,
}
}
fn hover_range(
item: &GlobalAttentionItem,
session_width: usize,
width: usize,
now: u64,
show_age: bool,
simplified_ui: bool,
) -> std::ops::Range<usize> {
let p... |
rust_dataset_chunk_511106 | rust_dataset.txt | 511,106 | 512 | () {
text = text.color_range(3, s..index + 1);
}
},
_ => {},
}
}
text
}
#[cfg(test)]
mod tests {
use super::*;
fn item(session: &str, id: u32, status: AttentionStatus, since_ms: u64) -> GlobalAttentionItem {
GlobalAttentionIte... |
rust_dataset_chunk_511107 | rust_dataset.txt | 511,107 | 512 | _seen = item("api", 1, AttentionStatus::NeedsYou, 500);
old_seen.item.attention.seen = true;
inbox.update_global(global(vec![
old_seen,
item("web", 2, AttentionStatus::Done, 300),
item("docs", 3, AttentionStatus::Failed, 100),
item("build", 4, AttentionSta... |
rust_dataset_chunk_511108 | rust_dataset.txt | 511,108 | 512 | api", "zed", "web"]);
assert_eq!(inbox.quiet_count(), 1);
assert!(inbox.select_newest_counted());
assert_eq!(inbox.selected_item().unwrap().session, "web");
inbox.select_item(ItemKey {
session: "zed".to_owned(),
pane_id: PaneId::Terminal(5),
});
as... |
rust_dataset_chunk_511109 | rust_dataset.txt | 511,109 | 512 | 1 · now",
"",
"Failed",
"✗ here pane2 · text 2 · now",
]
);
assert_eq!(inbox.item_ranges, vec![0..2, 3..5, 6..8]);
assert_eq!(inbox.selected_range, 0..2);
}
#[test]
fn this_session_only_lists_just_this_session() {
... |
rust_dataset_chunk_511110 | rust_dataset.txt | 511,110 | 512 | : false,
}]
);
let narrow: Vec<String> = inbox
.help_block(30, true)
.into_iter()
.map(|line| line.text)
.collect();
assert_eq!(narrow, vec!["<ENTER> go <?> more"]);
}
#[test]
fn scrolling_moves_by_whole_notifications_and_... |
rust_dataset_chunk_511111 | rust_dataset.txt | 511,111 | 512 | "{}", line);
}
#[test]
fn when_the_selected_item_clears_the_next_one_is_selected() {
let mut inbox = sample();
inbox.select_item(ItemKey {
session: "api".to_owned(),
pane_id: PaneId::Terminal(1),
});
inbox.update_global(global(vec![
item(... |
rust_dataset_chunk_511112 | rust_dataset.txt | 511,112 | 512 | , 50);
changed.item.attention.changed_ms = 120;
let mut untouched = item("api", 3, AttentionStatus::Done, 40);
untouched.item.attention.changed_ms = 60;
let mut quiet = item("build", 4, AttentionStatus::Quiet, 130);
quiet.item.attention.changed_ms = 130;
inbox.update_glob... |
rust_dataset_chunk_511113 | rust_dataset.txt | 511,113 | 512 | _label_changes_in_ms(0, 3_600_000 + 5_000), 3_595_000);
let mut inbox = sample();
let now = 100 + 2 * 3_600_000;
let seconds = inbox.seconds_until_an_age_changes(now).unwrap();
assert!(seconds <= AGE_CLOCK_MAX_MS as f64 / 1000.0 + AGE_CLOCK_SLACK_SECONDS);
inbox.update_global(glo... |
rust_dataset_chunk_511114 | rust_dataset.txt | 511,114 | 512 | "),
"{}",
line.line
);
}
fn column_starts(line: &str, needles: &[&str]) -> Vec<usize> {
needles
.iter()
.map(|needle| line[..line.find(needle).unwrap()].width())
.collect()
}
#[test]
fn every_row_lines_up_its_columns_inclu... |
rust_dataset_chunk_511115 | rust_dataset.txt | 511,115 | 512 | ays_when_empty() {
let mut inbox = Inbox::default();
inbox.tab = BrowserTab::Inbox;
inbox.tab_chosen = true;
inbox.update_global(global(vec![]));
assert_eq!(inbox.tab, BrowserTab::Inbox);
assert!(inbox.ordered().is_empty());
inbox.update_global(global(vec![item("a... |
rust_dataset_chunk_511116 | rust_dataset.txt | 511,116 | 512 | ![
item("api", 1, AttentionStatus::NeedsYou, 100),
item("build", 4, AttentionStatus::Quiet, 70),
]));
inbox.help_hints = browser_hints();
let help = inbox.help_block(56, false);
assert!(help[0].text.starts_with("<ENTER> go there <c> dismiss"));
render(&mu... |
rust_dataset_chunk_511117 | rust_dataset.txt | 511,117 | 512 | You, 100)]));
inbox.help_hints = browser_hints();
render(&mut inbox, 88, 15, false);
let layout = inbox.live_layout.expect("88 columns show the live view");
let rows: Vec<usize> = inbox
.browser_targets
.iter()
.filter(|(_, _, t)| *t == BrowserTarget::... |
rust_dataset_chunk_511118 | rust_dataset.txt | 511,118 | 512 | 300, 30).unwrap();
assert_eq!(wide.list_width, LIST_MAX_COLS);
let narrowest = LiveLayout::compute(0, 1, 54, 15).unwrap();
assert_eq!(narrowest.list_width, LIST_MIN_COLS);
assert_eq!(narrowest.view_rect().2, LIVE_VIEW_MIN_COLS);
assert_eq!(LiveLayout::compute(0, 1, 53, 15), None... |
rust_dataset_chunk_511119 | rust_dataset.txt | 511,119 | 512 | -> LiveViewStatus {
LiveViewStatus {
target: target.map(|key| PaneAddress::local(key.session, key.pane_id)),
state: MirrorState::Live,
input_captured: captured,
input_released_by: None,
resize_allowed: true,
pinned: captured,
s... |
rust_dataset_chunk_511120 | rust_dataset.txt | 511,120 | 512 | );
assert!(!inbox.is_capturing());
assert_eq!(
inbox.selected_item().map(ItemKey::of),
Some(key("here", 2)),
"a listed item the server cleared stays while the inbox is open"
);
assert!(inbox.is_held(&key("here", 2)));
inbox.dismiss_selected();
... |
rust_dataset_chunk_511121 | rust_dataset.txt | 511,121 | 512 | 80, rows: 24 });
inbox.apply_live_view_status(reported.clone());
assert_eq!(
inbox.live_view_details_text(),
"resize off · cropped from 80x24"
);
reported.state = MirrorState::Connecting;
inbox.apply_live_view_status(reported.clone());
assert_eq!(i... |
rust_dataset_chunk_511122 | rust_dataset.txt | 511,122 | 512 | .len()), 0);
assert_eq!(inbox.shown_end(&lines, 0, 5), 5);
assert_eq!(inbox.hidden_counts(0, 5), (0, 8));
inbox.move_selection(8);
let lines = inbox.block_lines(76, 200, false);
let scroll = inbox.scroll_for(5, lines.len());
let selected = inbox.selected_range.clone();
... |
rust_dataset_chunk_511123 | rust_dataset.txt | 511,123 | 512 | Text::from(text.clone())
.indices
.get(level)
.cloned()
.unwrap_or_default()
}
fn muted(mut item: GlobalAttentionItem) -> GlobalAttentionItem {
item.item.attention.muted = Some(MuteScope::Pane);
item
}
fn mixed() -> Inbox {
let mu... |
rust_dataset_chunk_511124 | rust_dataset.txt | 511,124 | 512 | ()
{
let mut inbox = mixed();
assert_eq!(
section_order(&inbox),
vec![
Group::Status(Section::Watching),
Group::Status(Section::NeedsYou),
Group::Status(Section::Failed),
Group::Status(Section::Done),
... |
rust_dataset_chunk_511125 | rust_dataset.txt | 511,125 | 512 | ".to_owned(), false),
Group::Session("web".to_owned(), false),
Group::Session("work".to_owned(), false),
]
);
assert_eq!(
places_in_order(&inbox),
places(&[
("here", 9),
("here", 2),
("api... |
rust_dataset_chunk_511126 | rust_dataset.txt | 511,126 | 512 | let mut long = item(
"a-very-long-session-name",
1,
AttentionStatus::NeedsYou,
100,
);
long.item.pane_title = "build-the-whole-workspace-now".to_owned();
let row = pane_row(&long, SESSION_COLUMN_MAX, 40, 200, false, false, false);
a... |
rust_dataset_chunk_511127 | rust_dataset.txt | 511,127 | 512 | for line in inbox.block_lines(40, 200, false) {
if let BlockLine::Item { text, .. } = line {
assert!(
!text.content().contains(" · "),
"rows beside the live view carry no detail or age: {:?}",
text.content()
... |
rust_dataset_chunk_511128 | rust_dataset.txt | 511,128 | 512 | ).all(|emphasis| level(&working, emphasis).is_empty()));
assert_eq!(level(&working, 4), (9..13).collect::<Vec<_>>());
let single = section_heading(Section::Working, 1, 40);
assert_eq!(
single.content().chars().count(),
"Working ⠋".chars().count()
);
assert... |
rust_dataset_chunk_511129 | rust_dataset.txt | 511,129 | 512 | ─ no pane selected ┐"));
}
#[test]
fn a_resize_change_made_elsewhere_is_adopted_but_the_plugins_own_change_is_kept() {
let mut inbox = sample();
render(&mut inbox, 88, 15, false);
let target = inbox.live_view_target();
let reported = |resize_allowed: bool| {
let ... |
rust_dataset_chunk_511130 | rust_dataset.txt | 511,130 | 512 | _empty());
inbox.toggle_resize();
render(&mut inbox, 88, 15, false);
inbox.toggle_resize();
render(&mut inbox, 88, 15, false);
assert_eq!(inbox.resize_requests_in_flight, [false, true]);
let mut unrelated = reported(true);
unrelated.pinned = true;
inbox.ap... |
rust_dataset_chunk_511131 | rust_dataset.txt | 511,131 | 512 | expect("the row is listed")
}
#[test]
fn a_done_item_seen_while_browsing_stays_dimmed_and_selected_until_the_inbox_closes() {
let mut inbox = browsed();
assert_eq!(inbox.counted_count(), 3);
inbox.update_global(with_sessions(
vec![
item("api", 1, Attentio... |
rust_dataset_chunk_511132 | rust_dataset.txt | 511,132 | 512 | browsed();
inbox.update_global(with_sessions(
vec![item("api", 1, AttentionStatus::NeedsYou, 300)],
&["web", "docs"],
));
assert!(inbox.is_held(&key("web", 2)));
inbox.update_global(global(vec![
item("api", 1, AttentionStatus::NeedsYou, 300),
... |
rust_dataset_chunk_511133 | rust_dataset.txt | 511,133 | 512 | _closed_panes_here(&[1]));
assert_eq!(sessions_in_order(&inbox), vec!["web", "docs"]);
let mut closed = live_status(Some(key("web", 2)), false);
closed.state = MirrorState::Closed(MirrorClosedReason::PaneClosed);
inbox.apply_live_view_status(closed);
assert_eq!(sessions_in_order(... |
rust_dataset_chunk_511134 | rust_dataset.txt | 511,134 | 512 | 200),
item("docs", 4, AttentionStatus::Failed, 100),
]));
view(&mut inbox, &[key("api", 1)]);
inbox.update_global(with_sessions(
vec![item("work", 2, AttentionStatus::Quiet, 300)],
&["api", "web", "docs"],
));
assert_eq!(sessions_in_order(&inb... |
rust_dataset_chunk_511135 | rust_dataset.txt | 511,135 | 512 | ();
assert!(inbox.is_held(&key("log", 2)));
assert_eq!(sessions_in_order(&inbox), vec!["api", "log"]);
assert_eq!(inbox.selected_item().map(ItemKey::of), Some(key("log", 2)));
assert_eq!(inbox.quiet_count(), 0);
assert!(inbox.forget_listed(), "closing the inbox lets it go");
... |
rust_dataset_chunk_511136 | rust_dataset.txt | 511,136 | 512 | );
assert!(inbox.live_view_target().is_some());
inbox.tab = BrowserTab::Sessions;
assert_eq!(inbox.live_view_target(), None);
inbox.apply_live_view_status(live_status(None, true));
assert_eq!(inbox.capture_target, None);
}
#[test]
fn a_seen_done_result_on_a_watched_p... |
rust_dataset_chunk_511137 | rust_dataset.txt | 511,137 | 512 | inbox.selected_target().map(status_title),
Some("Done"),
"with no server copy the held one is all there is"
);
let mut watched_web = watched(item("web", 2, AttentionStatus::Idle, 0));
watched_web.item.attention.ignore_output = true;
inbox.update_global... |
rust_dataset_chunk_511138 | rust_dataset.txt | 511,138 | 512 | assert_eq!(sessions_in_order(&inbox), vec!["web", "web", "docs", "api"]);
let mut not_found = live_status(Some(key("docs", 4)), false);
not_found.state = MirrorState::Closed(MirrorClosedReason::PaneNotFound);
inbox.apply_live_view_status(not_found);
assert_eq!(sessions_in_order(&inbox),... |
rust_dataset_chunk_511139 | rust_dataset.txt | 511,139 | 512 | inbox.is_held(&key("work", 2)));
assert_eq!(status_title(inbox.find(&key("work", 2)).unwrap()), "Done");
}
#[test]
fn headings_and_the_quiet_line_count_only_what_the_server_still_lists() {
let mut inbox = Inbox::default();
inbox.update_global(global(vec![
item("web", 2, ... |
rust_dataset_chunk_511140 | rust_dataset.txt | 511,140 | 512 | .iter().any(|line| line.contains("(")), "{:?}", lines);
}
#[test]
fn alt_enter_is_coloured_as_a_key_in_the_hint_lines_and_the_key_list() {
let key_range: Vec<usize> = (0..TYPE_KEY.chars().count()).collect();
let inbox = sample();
let under_view = inbox.view_hint(TYPE_INTO_IT_HINT, f... |
rust_dataset_chunk_511141 | rust_dataset.txt | 511,141 | 512 | default();
inbox.update_global(global(vec![
remembered_item("api", 1, AttentionStatus::Done),
item("here", 2, AttentionStatus::Failed, 90),
]));
assert!(inbox.is_held(&key("api", 1)));
assert_eq!(inbox.counted_count(), 1, "a remembered pane is not counted");
... |
rust_dataset_chunk_511142 | rust_dataset.txt | 511,142 | 512 | .find(&key("api", 1)).is_none());
assert!(inbox.held.is_empty());
}
#[test]
fn muted_or_watched_remembered_panes_are_not_recalled() {
let mut muted = remembered_item("api", 1, AttentionStatus::Done);
muted.item.attention.muted = Some(MuteScope::Pane);
let mut watched = remem... |
rust_dataset_chunk_511143 | rust_dataset.txt | 511,143 | 512 | , 64, 30, false);
assert_eq!(inbox.live_layout.unwrap().box_width, LIVE_VIEW_MIN_COLS);
}
#[test]
fn w_widens_the_list_to_half_the_width_and_back() {
let mut inbox = Inbox::default();
inbox.update_global(global(vec![item("api", 1, AttentionStatus::NeedsYou, 100)]));
render(&... |
rust_dataset_chunk_511144 | rust_dataset.txt | 511,144 | 512 | (),
since_ms: 100,
});
inbox.update_global(global(vec![
agent,
item("web", 2, AttentionStatus::NeedsYou, 90),
]));
inbox.select_item(key("api", 1));
inbox.dismiss_selected();
assert_eq!(inbox.selection, Some(key("web", 2)));
inb... |
rust_dataset_chunk_511145 | rust_dataset.txt | 511,145 | 512 | DeleteTarget, SingleScreenMode, SingleScreenState, UnifiedSearchResult};
use ui::{
components::{
render_controls_line, render_error, render_new_session_block, render_prompt,
render_renaming_session_screen, render_screen_toggle, render_single_screen_prompt,
render_unsaved_changes_line, Colors... |
rust_dataset_chunk_511146 | rust_dataset.txt | 511,146 | 512 | irmed: bool,
footer_deferred: bool,
show_all_keys: bool,
all_keys_scroll: usize,
last_cols: usize,
desktop_offer: DesktopOffer,
sessions_live_layout: Option<inbox::LiveLayout>,
backspace_erased_text: bool,
}
#[derive(Default)]
struct DesktopOffer {
state: Option<desktop_integration::Int... |
rust_dataset_chunk_511147 | rust_dataset.txt | 511,147 | 512 | self.is_welcome_screen = configuration
.get("welcome_screen")
.map(|v| v == "true")
.unwrap_or(false);
if self.is_welcome_screen {
self.active_screen = ActiveScreen::NewSession;
}
self.new_session_info.is_welcome_screen = self.is_welcome_sc... |
rust_dataset_chunk_511148 | rust_dataset.txt | 511,148 | 512 | .is_popup = false;
self.panel.size = Some(PanelSize::Manager);
self.panel.needs_initial_layout = false;
self.inbox.tab = BrowserTab::Sessions;
self.inbox.tab_chosen = true;
self.inbox.select_newest_on_arrival = true;
... |
rust_dataset_chunk_511149 | rust_dataset.txt | 511,149 | 512 | self, rows: usize, cols: usize) {
self.render_plugin(rows, cols);
}
}
impl State {
fn settle_inbox_hold(&mut self) -> bool {
if self.is_visible && self.browser_is_open() {
return self.forget_closed_inbox_panes();
}
self.inbox.forget_listed();
false
}
... |
rust_dataset_chunk_511150 | rust_dataset.txt | 511,150 | 512 | imers::TimerOwner::Clock) => {
self.inbox.clock_armed = false;
return self.is_visible && self.shows_ages();
},
Some(timers::TimerOwner::Spinner) => {
self.inbox.spinner_armed = false;
return self.is_visible &... |
rust_dataset_chunk_511151 | rust_dataset.txt | 511,151 | 512 | {
should_render = self.handle_key(key);
},
Event::PermissionRequestResult(_result) => {
should_render = true;
},
Event::SessionUpdate(session_infos, _) if self.panel.size.is_some() => {
for session_info in &session_infos {
... |
rust_dataset_chunk_511152 | rust_dataset.txt | 511,152 | 512 | set(&global.badge_colors);
self.panel.attention = Some(global.clone());
should_render = self.inbox.update_global(global);
if self.attention_disabled() {
if self.panel.size == Some(PanelSize::Card) {
close_self();
... |
rust_dataset_chunk_511153 | rust_dataset.txt | 511,153 | 512 | },
Event::SavedSessionPreview(preview) => {
if self.panel.tree.set_children_from_saved(&preview) {
should_render = true;
}
if self.panel.preview_session.as_deref() == Some(preview.session_name.as_str())
&& self.panel.sa... |
rust_dataset_chunk_511154 | rust_dataset.txt | 511,154 | 512 | == BrowserTab::Inbox
{
self.refresh_inbox_window_help();
self.inbox.live_mode = self
.inbox
.plan_live_layout(0, 1, cols, rows.saturating_sub(1))
.is_some();
}
if !self.is_visible {
self.inbox.clear_live_view();... |
rust_dataset_chunk_511155 | rust_dataset.txt | 511,155 | 512 | usize) {
let list_cols = Self::sessions_list_cols(cols);
let top = if self.panel.size == Some(PanelSize::Manager) && self.shows_browser_tabs() {
1
} else {
0
};
let footer = if self.error.is_none() {
self.footer_rows_for(cols)
} else {... |
rust_dataset_chunk_511156 | rust_dataset.txt | 511,156 | 512 | ;
}
if self.pending_remote_window.is_some() {
self.render_remote_window_warning(rows, cols);
return;
}
self.last_cols = cols;
if self.show_all_keys {
let hints = self.all_keys();
let mut scroll = self.all_keys_scroll;
he... |
rust_dataset_chunk_511157 | rust_dataset.txt | 511,157 | 512 | = self.selected_session_is_exited();
render_preview(
&mut self.panel,
list_cols + 1,
top,
cols.saturating_sub(list_cols + 1),
rows.saturating_sub(top + foo... |
rust_dataset_chunk_511158 | rust_dataset.txt | 511,158 | 512 | ("Resurrect"),
}
} else {
let typed = &self.single_screen_state.search_term;
if self.sessions.has_session(typed) {
Some("Attach")
} else if self.resurrectable_sessions.has_session(typed) {
Some("Resurrect... |
rust_dataset_chunk_511159 | rust_dataset.txt | 511,159 | 512 | 2
}
fn render_footer(&self, x: usize, width: usize, rows: usize, centered: bool) {
if self.active_screen == ActiveScreen::SingleScreen {
let help_width = self.help_width(width);
let lines = self.sessions_help_block(help_width);
let y = rows.saturating_sub(lines.len()... |
rust_dataset_chunk_511160 | rust_dataset.txt | 511,160 | 512 | , width, x, y + 2);
} else if self.show_kill_all_sessions_warning {
self.render_kill_all_sessions_warning(height, width, x, y);
} else {
render_prompt(&self.search_term, self.colors, x, y + 2);
let bottom_lines = 7;
... |
rust_dataset_chunk_511161 | rust_dataset.txt | 511,161 | 512 | x_centered = x + (width.saturating_sub(content_width)) / 2;
render_single_screen_prompt(
&self.single_screen_state.search_term,
None,
&[],
content_width,
... |
rust_dataset_chunk_511162 | rust_dataset.txt | 511,162 | 512 | _text_with_coordinates(layout_indication_line, x, y + 2, None, None);
println!();
let max_layout_rows = height.saturating_sub(8);
let mut table = Table::new();
for (i, (layout_info, indices, is_selected)) in self
... |
rust_dataset_chunk_511163 | rust_dataset.txt | 511,163 | 512 | fn handle_key(&mut self, key: KeyWithModifier) -> bool {
if self.app_quit {
match key.bare_key {
BareKey::Enter | BareKey::Char('y') | BareKey::Char('Y')
if key.has_no_modifiers() || key.has_only_modifiers(&[KeyModifier::Shift]) =>
{
... |
rust_dataset_chunk_511164 | rust_dataset.txt | 511,164 | 512 | AttachToSession => self.handle_attach_to_session(key),
ActiveScreen::ResurrectSession => self.handle_resurrect_session_key(key),
ActiveScreen::SingleScreen => self.handle_single_screen_key(key),
}
}
fn erasable_text(&self) -> Option<&str> {
if self.renaming_session_name.i... |
rust_dataset_chunk_511165 | rust_dataset.txt | 511,165 | 512 | {
self.new_session_info.handle_key(key);
should_render = true;
},
BareKey::Char('w') if key.has_modifiers(&[KeyModifier::Ctrl]) => {
self.active_screen = ActiveScreen::NewSession;
should_render = true;
},
Ba... |
rust_dataset_chunk_511166 | rust_dataset.txt | 511,166 | 512 | _index.0;
match kill_sessions(&all_other_sessions) {
Ok(()) => {
self.sessions
.session_ui_infos
.retain(|s| !all_other_sessions.contains(&s.name));
self.se... |
rust_dataset_chunk_511167 | rust_dataset.txt | 511,167 | 512 | self.renaming_session_name = None;
} else {
zellij_tile::graphemes::pop_cluster(new_session_name);
}
} else {
zellij_tile::graphemes::pop_cluster(&mut self.search_term);
self.... |
rust_dataset_chunk_511168 | rust_dataset.txt | 511,168 | 512 | Ctrl]) => {
if !self.search_term.is_empty() {
self.search_term.clear();
self.sessions
.update_search_term(&self.search_term, &self.colors);
self.reset_selected_index();
} else if !... |
rust_dataset_chunk_511169 | rust_dataset.txt | 511,169 | 512 | key.has_no_modifiers() => {
self.toggle_active_screen();
should_render = true;
},
BareKey::Delete if key.has_no_modifiers() => {
self.resurrectable_sessions.delete_selected_session();
should_render = true;
},
... |
rust_dataset_chunk_511170 | rust_dataset.txt | 511,170 | 512 |
if self.show_kill_all_sessions_warning {
match key.bare_key {
BareKey::Char('y') if key.has_no_modifiers() => {
let all_other_sessions = self.sessions.all_other_sessions();
let previous_index = self.single_screen_state.selected_index;
... |
rust_dataset_chunk_511171 | rust_dataset.txt | 511,171 | 512 | }
return should_render;
}
let is_tab_key = key.bare_key == BareKey::Tab
&& (key.has_no_modifiers() || key.has_only_modifiers(&[KeyModifier::Shift]));
if !is_tab_key {
self.single_screen_state.reset_tab_cycle();
}
match key.bare_ke... |
rust_dataset_chunk_511172 | rust_dataset.txt | 511,172 | 512 | .single_screen_state.transition_to_layout_selection();
should_render = true;
},
BareKey::Delete if key.has_no_modifiers() => {
let selected = self
.single_screen_state
.get_selected_result()
.map(|r| r.as... |
rust_dataset_chunk_511173 | rust_dataset.txt | 511,173 | 512 | _index = None;
should_render = true;
} else if !self.is_welcome_screen {
close_self();
}
},
_ => {},
}
should_render
}
fn handle_single_screen_layout_key(&mut self, key: KeyWithModifier) -> bool {
... |
rust_dataset_chunk_511174 | rust_dataset.txt | 511,174 | 512 | None;
should_render = true;
},
BareKey::Esc if key.has_no_modifiers() => {
self.single_screen_state.transition_to_search();
should_render = true;
},
_ => {},
}
should_render
}
fn handle_selection(&mu... |
rust_dataset_chunk_511175 | rust_dataset.txt | 511,175 | 512 | let mut switched_session = false;
if let Some(selected_session_name) = self.sessions.get_selected_session_name() {
let selected_tab = self.sessions.get_selected_tab_position();
let selected_pane = self.sessions.get_selected_pane_id();
let is_c... |
rust_dataset_chunk_511176 | rust_dataset.txt | 511,176 | 512 | resurrectable_sessions
.has_session(&renaming_session_name)
{
self.show_error("A resurrectable session by this name already exists.");
return;
} else {
if renaming_session_name.contain... |
rust_dataset_chunk_511177 | rust_dataset.txt | 511,177 | 512 | _session(&typed_name, true);
if self.is_welcome_screen {
quit_zellij();
} else {
close_self();
}
}
... |
rust_dataset_chunk_511178 | rust_dataset.txt | 511,178 | 512 | <std::path::PathBuf>,
) {
switch_session_with_options(ConnectToSession {
name: name.map(|n| n.to_owned()),
layout,
cwd,
switch_context: if self.is_welcome_screen {
Some(SwitchContext::with_startup_card(StartupCard::Never))
} else {
... |
rust_dataset_chunk_511179 | rust_dataset.txt | 511,179 | 512 | .inbox.current_session = self.session_name.clone();
if self.panel.size == Some(PanelSize::Manager) {
self.apply_suggestions_to_list();
}
}
fn listed_current_session(&self) -> Option<String> {
if app_panel::is_enabled() || self.is_welcome_screen {
return None;
... |
rust_dataset_chunk_511180 | rust_dataset.txt | 511,180 | 512 | _folder_str = new_session_folder.display().to_string();
let change_folder_shortcut = self.colors.shortcuts("<Ctrl f>");
let reset_folder_shortcut = self.colors.shortcuts("<Ctrl c>");
if max_cols >= folder_prompt.len() + new_session_folder_str.len() + 30 {
... |
rust_dataset_chunk_511181 | rust_dataset.txt | 511,181 | 512 | {
self.show_error(&format!("Failed to delete session: {}", e));
},
}
}
fn exited_session_count(&self) -> usize {
self.resurrectable_sessions.all_resurrectable_sessions.len()
}
fn delete_all_exited_sessions(&mut self) {
let previous_index = self.single... |
rust_dataset_chunk_511182 | rust_dataset.txt | 511,182 | 512 | {}", sanitize_display_text(name)),
"Are you sure? (y/n)".to_owned(),
)
}
pub(crate) fn delete_exited_warning_lines(count: usize) -> (String, String) {
(
format!(
"This will delete all {} exited {}",
count,
if count == 1 { "session" } else { "sessions" }
... |
rust_dataset_chunk_511183 | rust_dataset.txt | 511,183 | 512 | print_text_with_coordinates(
Text::from(confirmation.as_str()).color_indices(2, vec![15, 17]),
confirmation_x,
y + (rows / 2) + 1,
None,
None,
);
}
fn remote_window_warning_lines(remote: &str, leave: bool) -> Vec<String> {
let mut lines = vec![
format!("You a... |
rust_dataset_chunk_511184 | rust_dataset.txt | 511,184 | 512 | }
fn selected_has_window(&self, name: &str) -> bool {
self.panel
.suggestions
.as_ref()
.map(|s| s.desktop_window_sessions.iter().any(|w| w == name))
.unwrap_or(false)
}
fn can_close_this_window(&self) -> bool {
self.desktop_app_running() && !... |
rust_dataset_chunk_511185 | rust_dataset.txt | 511,185 | 512 | }
fn way_available(&self, way: OpenWay, target: &OpenTarget, inbox: bool) -> bool {
match way {
OpenWay::Window => true,
OpenWay::WindowAndLeave => self.can_close_this_window() && !target.current,
OpenWay::DisconnectOthers if inbox => !target.current || !app_panel::is... |
rust_dataset_chunk_511186 | rust_dataset.txt | 511,186 | 512 | _list(true),
OpenWay::DisconnectOthers => false,
}),
SingleScreenMode::SearchAndSelect => {
if self.panel.size == Some(PanelSize::Manager) && self.on_exited_header() {
return Some(false);
}
let target = self.sess... |
rust_dataset_chunk_511187 | rust_dataset.txt | 511,187 | 512 | handle_remote_window_key(&mut self, key: &KeyWithModifier) -> bool {
match key.bare_key {
BareKey::Enter | BareKey::Char('y') | BareKey::Char('Y')
if key.has_no_modifiers() || key.has_only_modifiers(&[KeyModifier::Shift]) =>
{
if let Some(pending) = self.... |
rust_dataset_chunk_511188 | rust_dataset.txt | 511,188 | 512 | = if typed.is_empty() {
None
} else {
Some(typed.as_str())
};
let request = SessionTerminalRequest::new_session(
name,
self.single_screen_state.layout_list.selected_layout_info(),
self.single_screen_state.new_session_folder.clone(),
... |
rust_dataset_chunk_511189 | rust_dataset.txt | 511,189 | 512 | _desktop_app(&mut self) {
if self.desktop_offer.asked || app_panel::is_enabled() || !self.inbox_is_shown() {
return;
}
let (Some(state), Some(reminders)) =
(&self.desktop_offer.state, &self.desktop_offer.reminders)
else {
return;
};
sel... |
rust_dataset_chunk_511190 | rust_dataset.txt | 511,190 | 512 | "go there, disconnect others"
} else if target.is_here() {
"disconnect others from this session"
} else {
"open here, disconnect others"
},
));
}
if has_window_hints && self.remote_client.is_some() {
... |
rust_dataset_chunk_511191 | rust_dataset.txt | 511,191 | 512 | a new session"));
hints.push(hint("<←→>", "show tabs and panes"));
hints.push(hint("<Ctrl l>", "new session with a layout"));
hints.push(hint("<Ctrl r>", "rename this session"));
hints.push(hint("<Del>", "stop or delete the selected session"));
if self.exited_session_count() > 0... |
rust_dataset_chunk_511192 | rust_dataset.txt | 511,192 | 512 | {
hints.push(hint("<TAB>", "sessions"));
}
hints.push(hint("<ESC>", "close"));
hints.push(hint("<?>", "all keys"));
return hints;
}
let item = self.inbox.selected_target();
let muted = item.map(|i| i.item.attention.is_muted()).unwr... |
rust_dataset_chunk_511193 | rust_dataset.txt | 511,193 | 512 | (hint(
"<s>",
if self.inbox.group_by_session {
"group by status"
} else {
"group by session"
},
));
hints.push(hint(
"<a>",
format!(
"show items with only new output, quiet or muted ({... |
rust_dataset_chunk_511194 | rust_dataset.txt | 511,194 | 512 | let was_card = self.panel.size == Some(PanelSize::Card);
self.panel.apply_size(size);
if size != PanelSize::Card {
if was_card {
self.apply_suggestions_to_list();
}
if self.inbox.tab == BrowserTab::Sessions {
self.preselect_previous_se... |
rust_dataset_chunk_511195 | rust_dataset.txt | 511,195 | 512 | current.as_ref() {
let first_exited = ordered
.iter()
.position(|s| !s.is_running)
.unwrap_or(ordered.len());
ordered_names.insert(first_exited, current.clone());
let tab_count = self.last_tab_count.unwrap_or(1).max(1);
let... |
rust_dataset_chunk_511196 | rust_dataset.txt | 511,196 | 512 | std::time::Duration::from_secs(suggestion.created_secs_ago),
));
}
}
for suggestion in &suggestions.suggestions {
if suggestion.is_running && !suggestion.tabs.is_empty() {
self.panel
.tree
... |
rust_dataset_chunk_511197 | rust_dataset.txt | 511,197 | 512 | => (None, None),
session_tree::TreeNode::Tab(tab) => (Some(tab), None),
session_tree::TreeNode::Pane(tab, pane) => (Some(tab), Some(pane)),
}
} else {
(None, None)
};
self.panel
... |
rust_dataset_chunk_511198 | rust_dataset.txt | 511,198 | 512 | _is_exited() {
self.panel.preview_pan.apply(pan_move, 0);
return Some(true);
}
}
{
match key.bare_key {
BareKey::Tab
if key.has_no_modifiers()
&& self.shows_browser_tabs()
... |
rust_dataset_chunk_511199 | rust_dataset.txt | 511,199 | 512 | _left();
Some(true)
},
BareKey::Enter if key.has_no_modifiers() => {
if self.open_tree_child() {
Some(false)
} else {
None
}
},
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.