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_510700 | rust_dataset.txt | 510,700 | 512 | info(
"Border bottom",
"Line style for the bottom border of tiled panes",
OptionalChoice(LINE_STYLES),
"border style",
Everyone,
),
SettingKey::FrameBorderLeft => info(
"Border left",
"Line style for the left border of ... |
rust_dataset_chunk_510701 | rust_dataset.txt | 510,701 | 512 | ,
),
SettingKey::PluginAliases => info(
"Plugin aliases",
"Names for plugins, used by layouts, keybindings and other plugins",
Block,
"built-in aliases",
Everyone,
),
SettingKey::LoadPlugins => info(
"Plugins loaded ... |
rust_dataset_chunk_510702 | rust_dataset.txt | 510,702 | 512 | Toggle,
"false",
Everyone,
),
SettingKey::ContextMenuEnabled => info(
"Right-click menu",
"A right click opens the menu; when off it goes to the focused pane",
Toggle,
"true",
Everyone,
),
Set... |
rust_dataset_chunk_510703 | rust_dataset.txt | 510,703 | 512 | a command fails",
Toggle,
"true",
OnlyYou,
),
SettingKey::AttentionPopupDone => info(
"Done pop-ups",
"Show a desktop notification when a long command finishes",
Toggle,
"true",
OnlyYou,
),
S... |
rust_dataset_chunk_510704 | rust_dataset.txt | 510,704 | 512 | ::AttentionBadgeColorQuiet => info(
"Gone quiet colour",
"Tray badge colour for panes that went quiet; not set uses gray",
Text(TextCheck::Colour),
"#8b8d98",
OnlyYou,
),
SettingKey::AttentionBadgeColorNewOutput => info(
"New output... |
rust_dataset_chunk_510705 | rust_dataset.txt | 510,705 | 512 | "Default shell",
"Program started in new terminal panes",
Text(TextCheck::Path),
"$SHELL",
Everyone,
),
SettingKey::DefaultCwd => info(
"Default folder",
"Starting folder for new panes",
Text(TextCheck::Path),
... |
rust_dataset_chunk_510706 | rust_dataset.txt | 510,706 | 512 | Choice(&["ask", "fullscreen", "descend", "never"]),
"ask",
Everyone,
),
SettingKey::ScrollBufferSize => info(
"Scrollback lines",
"Lines kept in each pane's scrollback",
Number {
min: 0,
max: 1_000_000,
... |
rust_dataset_chunk_510707 | rust_dataset.txt | 510,707 | 512 | _quit",
Everyone,
),
SettingKey::OnForceClose => info(
"On force close",
"Detach or quit when the terminal closes",
Choice(&["detach", "quit"]),
"detach",
Everyone,
),
SettingKey::DisableSessionMetadata => info(
... |
rust_dataset_chunk_510708 | rust_dataset.txt | 510,708 | 512 | ::WebServerPort => info(
"Port",
"Port the web server listens on",
Number {
min: 1,
max: 65_535,
step: 1,
},
"8082",
Everyone,
),
SettingKey::WebServerCert => info(
"Certif... |
rust_dataset_chunk_510709 | rust_dataset.txt | 510,709 | 512 | focused",
OptionalChoice(&["outline", "block", "bar", "underline", "no_style"]),
"outline",
Everyone,
),
SettingKey::WebClientMacOptionIsMeta => info(
"Option is Meta (macOS)",
"Treat the macOS Option key as Meta",
Toggle,
... |
rust_dataset_chunk_510710 | rust_dataset.txt | 510,710 | 512 | on this computer for characters the chosen font lacks",
Toggle,
"true",
OnlyYou,
),
SettingKey::TerminalLigatures => info(
"Ligatures",
"Join character sequences into ligatures when the font has them",
Toggle,
"true",
... |
rust_dataset_chunk_510711 | rust_dataset.txt | 510,711 | 512 | SettingKey::TerminalOpacity => info(
"Opacity",
"Window opacity from 0 (clear) to 1 (solid)",
Decimal {
min: 0,
max: 100,
step: 10,
decimals: 2,
},
"1",
OnlyYou,
),
... |
rust_dataset_chunk_510712 | rust_dataset.txt | 510,712 | 512 | },
"same as padding",
OnlyYou,
),
SettingKey::TerminalPaddingLeft => info(
"Padding left",
"Space left of the text, in pixels",
Decimal {
min: 0,
max: 10_000,
step: 10,
decimals: ... |
rust_dataset_chunk_510713 | rust_dataset.txt | 510,713 | 512 | 1 (off) to 21",
Decimal {
min: 10,
max: 210,
step: 5,
decimals: 1,
},
"1",
OnlyYou,
),
SettingKey::TerminalSmoothScrolling => info(
"Smooth scrolling",
"Animate scroll... |
rust_dataset_chunk_510714 | rust_dataset.txt | 510,714 | 512 | Key::TerminalMiddleClickPaste => info(
"Middle-click paste",
"Paste with the middle mouse button",
Toggle,
"true",
OnlyYou,
),
SettingKey::TerminalAllowRemoteClipboardRead => info(
"Remote sessions can read the clipboard",
... |
rust_dataset_chunk_510715 | rust_dataset.txt | 510,715 | 512 | ",
Text(TextCheck::Colour),
"from theme",
OnlyYou,
),
SettingKey::TerminalColorBackground => info(
"Background",
"Background color; not set uses the theme",
Text(TextCheck::Colour),
"from theme",
OnlyYou,
... |
rust_dataset_chunk_510716 | rust_dataset.txt | 510,716 | 512 | Key::TerminalColorBrightRed => info(
"Bright red",
"Terminal color bright red; not set uses the theme",
Text(TextCheck::Colour),
"from theme",
OnlyYou,
),
SettingKey::TerminalColorBrightGreen => info(
"Bright green",
"Te... |
rust_dataset_chunk_510717 | rust_dataset.txt | 510,717 | 512 | "Window",
"Padding",
"Spacing",
"Scrolling",
"Window behaviour",
"Shortcuts",
"Text and cursor",
"Terminal colors",
"Server",
"Browser client",
];
const ADVANCED_SECTIONS: [&str; 4] = ["Plugins", "Folders", "Terminal support", "Security"];
pub fn placement(key: SettingKey) -> (... |
rust_dataset_chunk_510718 | rust_dataset.txt | 510,718 | 512 | Bindings, ""),
CopyCommand | CopyClipboard | CopyOnSelect => (C::Clipboard, "Clipboard"),
Osc133CommandSelection | WordSeparators => (C::Clipboard, "Selection"),
AutoLayout
| StackedResize
| StackedPaneList
| StackedPaneListOrientation
| SwapLayoutNotification => ... |
rust_dataset_chunk_510719 | rust_dataset.txt | 510,719 | 512 | ellijTerminal, "Font"),
TerminalCursorStyle | TerminalCursorBlink | TerminalCursorUnfocusedHollow => {
(C::ZellijTerminal, "Cursor")
},
TerminalStartupMode
| TerminalTerminalRequests
| TerminalInitialColumns
| TerminalInitialRows
| TerminalOpacity
... |
rust_dataset_chunk_510720 | rust_dataset.txt | 510,720 | 512 | WebServer
| WebSharing
| WebServerIp
| WebServerPort
| WebServerCert
| WebServerKey
| EnforceHttpsForLocalhost
| ClientAsyncWorkerTasks => (C::Web, "Server"),
WebClientFont
| WebClientFontSize
| WebClientCursorBlink
| WebClientCurs... |
rust_dataset_chunk_510721 | rust_dataset.txt | 510,721 | 512 | !category.has_rows() {
return vec![];
}
all_row_settings()
.iter()
.copied()
.filter(|key| placement(*key).0 == category)
.collect()
}
pub fn all_row_settings() -> &'static [SettingKey] {
static KEYS: std::sync::OnceLock<Vec<SettingKey>> = std::sync::OnceLock::new()... |
rust_dataset_chunk_510722 | rust_dataset.txt | 510,722 | 512 | .search_words()).to_lowercase();
words.contains(&query) || fuzzy_match_indices(&query, &page.title().to_lowercase()).is_some()
}
fn readable(value: &str) -> String {
let spaced = value.replace('_', " ");
let mut characters = spaced.chars();
match characters.next() {
Some(first) => first.to_uppe... |
rust_dataset_chunk_510723 | rust_dataset.txt | 510,723 | 512 | choices,
_ => &[],
};
choices
.iter()
.find(|value| choice_label(key, value) == label)
.map(|value| value.to_string())
.unwrap_or_else(|| option_value(label).to_owned())
}
pub fn needs_attention(key: SettingKey) -> bool {
key != SettingKey::AttentionEnabled
... |
rust_dataset_chunk_510724 | rust_dataset.txt | 510,724 | 512 | Check::Colour => match parse_hex_colour(text.trim()) {
Some(_) => Ok(()),
None => Err("Use a hex color, eg. #1e1e2e".to_owned()),
},
}
}
pub fn parse_hex_colour(text: &str) -> Option<(u8, u8, u8)> {
let digits = text.strip_prefix('#')?;
if !digits.chars().all(|c| c.is_ascii_... |
rust_dataset_chunk_510725 | rust_dataset.txt | 510,725 | 512 | ("nonsense"), None);
}
#[test]
fn attention_features_comes_first_and_everything_else_on_both_pages_depends_on_it() {
let attention = settings_in(Category::Attention);
assert_eq!(attention.first(), Some(&SettingKey::AttentionEnabled));
assert!(!needs_attention(SettingKey::AttentionEn... |
rust_dataset_chunk_510726 | rust_dataset.txt | 510,726 | 512 | == SettingValueShape::Number
},
SettingKind::Decimal { .. } => key.value_shape() == SettingValueShape::Decimal,
SettingKind::Text(TextCheck::KeyList) | SettingKind::Text(TextCheck::WordList) => {
key.value_shape() == SettingValueShape::List
... |
rust_dataset_chunk_510727 | rust_dataset.txt | 510,727 | 512 | key
);
}
for page in SUB_PAGES {
assert!(section_index(page.link_section()) < SECTION_ORDER.len() + 4);
assert!(page.parent().is_some());
assert!(page.link_key().is_some());
}
}
#[test]
fn every_sub_page_is_linked_from_a_top_level_cat... |
rust_dataset_chunk_510728 | rust_dataset.txt | 510,728 | 512 | its_name() {
assert_eq!(option_value("nord (missing)"), "nord");
assert_eq!(option_value("nord"), "nord");
assert_eq!(option_value(UNSET_CHOICE), UNSET_CHOICE);
}
#[test]
fn values_are_written_as_kdl_of_the_right_type() {
assert_eq!(kdl_for(SettingKey::MouseMode, "false"), "... |
rust_dataset_chunk_510729 | rust_dataset.txt | 510,729 | 512 | 05");
},
other => panic!("{} is edited with {:?}", key, other),
}
}
assert_eq!(
describe(SettingKey::TerminalFont).kind,
SettingKind::FontFamily {
unset: BUNDLED_FONT
}
);
}
#[test]
fn wh... |
rust_dataset_chunk_510730 | rust_dataset.txt | 510,730 | 512 | ,
};
use crate::settings::{
check_text, choice_label, danger_warning, describe, inherits_from, kdl_for, needs_attention,
option_value, page_matches, parse_hex_colour, placement, search_settings, section, settings_in,
value_for_label, Category, Scope, SettingInfo, SettingKind, TextCheck, CATEGORIES,
MISS... |
rust_dataset_chunk_510731 | rust_dataset.txt | 510,731 | 512 | (Debug, Clone, Copy, PartialEq, Eq)]
enum FileChangeReaction {
AskWhatToDo,
Ignore,
ShowReloaded,
}
fn reaction_to_file_change(state: SaveState) -> FileChangeReaction {
match state {
SaveState::AwaitingSave => FileChangeReaction::AskWhatToDo,
SaveState::AwaitingOverwrite => FileChangeRe... |
rust_dataset_chunk_510732 | rust_dataset.txt | 510,732 | 512 | >,
window_title: String,
file_link_hovered: bool,
last_mouse: Option<(isize, usize)>,
setup_requested: bool,
sub_page: Option<Category>,
label_width: usize,
value_width: Option<usize>,
sorted_theme_names: Vec<String>,
page_haystacks: Vec<(Category, String)>,
help: Option<HelpView... |
rust_dataset_chunk_510733 | rust_dataset.txt | 510,733 | 512 | _candidate: None,
rows_area: None,
}
}
}
fn colour_swatch(value: Option<&str>, x: usize, y: usize) -> Option<String> {
let (r, g, b) = parse_hex_colour(value?.trim())?;
Some(format!(
"\u{1b}[{};{}H\u{1b}[0m\u{1b}[38;2;{};{};{}m██\u{1b}[0m",
y + 1,
x + 1,
... |
rust_dataset_chunk_510734 | rust_dataset.txt | 510,734 | 512 | let mut key_ranges = vec![];
for (index, (key, action)) in hints.iter().enumerate() {
let separator = if index == 0 { "" } else { ", " };
let entry = format!("{}{} - {}", separator, key, action);
if zellij_tile::graphemes::display_width(&line)
+ zellij_tile::graphemes::displa... |
rust_dataset_chunk_510735 | rust_dataset.txt | 510,735 | 512 | _sub_page(page);
} else if let Some(index) = CATEGORIES.iter().position(|c| *c == page) {
self.menu.set_selected(index);
self.select_category();
self.set_focus(Focus::Content);
}
}
fn close_sub_page(&mut self) -> bool {
let Some(page) = self.sub_page.t... |
rust_dataset_chunk_510736 | rust_dataset.txt | 510,736 | 512 | return false;
}
self.page_ref(self.category())
.map(|page| page.captures_keys())
.unwrap_or(false)
}
fn showing_bindings(&self) -> bool {
self.showing_keys_screen() && self.bindings_focused && self.focus == Focus::Content
}
fn page_hints(&self) -> Vec<(&'... |
rust_dataset_chunk_510737 | rust_dataset.txt | 510,737 | 512 | , key: SettingKey) -> Option<String> {
self.setting(key).and_then(|s| s.current_value.clone())
}
pub fn refresh(&mut self) {
self.snapshot = read_config();
self.update_snapshot_caches();
self.keys_screen.set_snapshot(&self.snapshot);
self.keybindings_screen.set_snapshot(&... |
rust_dataset_chunk_510738 | rust_dataset.txt | 510,738 | 512 | if query.chars().count() < 3 {
return false;
}
self.page_haystacks
.iter()
.any(|(candidate, haystack)| *candidate == page && haystack.contains(&query))
}
fn theme_note_needed(&self) -> bool {
self.current_value(SettingKey::ThemeDark).is_some()
... |
rust_dataset_chunk_510739 | rust_dataset.txt | 510,739 | 512 | describe(*key).name.chars().count())
.max()
.unwrap_or(0)
.min(MAX_LABEL_WIDTH)
+ 2;
if !self.search_active {
if let Some(page) = self.sub_page.filter(|page| page.has_rows()) {
let parent = page.parent().unwrap_or(Category::General).ti... |
rust_dataset_chunk_510740 | rust_dataset.txt | 510,740 | 512 | Option<(SettingKey, Element)> = match &row {
Row::Setting(key) => self.build_element(*key).map(|element| (*key, element)),
Row::Link(page) => page.link_key().map(|key| {
let label = if self.search_active {
format!("{} ({})", pa... |
rust_dataset_chunk_510741 | rust_dataset.txt | 510,741 | 512 | .len()
.max(format_scaled(max, decimals).len())
.max(format_scaled(max - 1, decimals).len()),
_ => self
.choice_options(key, &info)
.iter()
.map(|option| option.chars().count())
... |
rust_dataset_chunk_510742 | rust_dataset.txt | 510,742 | 512 | "true".to_owned(),
"false".to_owned(),
],
SettingKind::Theme { can_be_unset } => self.theme_options(can_be_unset, ¤t),
SettingKind::FontFamily { unset } => self.font_options(unset, ¤t),
_ => vec![],
}
}
fn font_options(&self, u... |
rust_dataset_chunk_510743 | rust_dataset.txt | 510,743 | 512 | ) -> i64 {
self.current_value(key)
.or_else(|| inherits_from(key).and_then(|from| self.current_value(from)))
.and_then(|v| parse_scaled(&v, decimals))
.or_else(|| parse_scaled(describe(key).default, decimals))
.unwrap_or(min)
}
fn optional_number_value(&se... |
rust_dataset_chunk_510744 | rust_dataset.txt | 510,744 | 512 | decimals,
} => NumberStepper::new(info.name, self.decimal_value(key, min, decimals))
.decimals(decimals)
.min(min)
.max(max)
.step(step)
.label_width(label_width)
.into(),
SettingKind::OptionalNumber... |
rust_dataset_chunk_510745 | rust_dataset.txt | 510,745 | 512 | let current = self.current_value(key).unwrap_or_default();
let editing = self.editing == Some(key);
if let Some(input) = self.elements.text_input_mut(&key) {
if !editing && input.get_text() != current {
input.set_text(current);... |
rust_dataset_chunk_510746 | rust_dataset.txt | 510,746 | 512 | : SettingKey) -> i64 {
match describe(key).kind {
SettingKind::Decimal { min, decimals, .. } => self.decimal_value(key, min, decimals),
SettingKind::OptionalNumber { .. } => self.optional_number_value(key),
SettingKind::Number { min, .. } => self.number_value(key, min),
... |
rust_dataset_chunk_510747 | rust_dataset.txt | 510,747 | 512 | }
fn open_changed_outside_dialog(&mut self) {
self.awaiting_save = None;
let file = self
.snapshot
.config_file_path
.clone()
.unwrap_or_else(|| "The config file".to_owned());
let request = PromptRequest::menu(vec![
ChoiceItem::lab... |
rust_dataset_chunk_510748 | rust_dataset.txt | 510,748 | 512 | overwrite_config_file();
},
Some(RELOAD_CHOICE) => {
self.awaiting_save = None;
self.awaiting_reload = true;
self.save_state = SaveState::Idle;
reload_config_file();
},
_ => {... |
rust_dataset_chunk_510749 | rust_dataset.txt | 510,749 | 512 | mem::replace(&mut self.awaiting_reload, false) {
let unsaved = self.snapshot.unsaved_count();
self.notice = Some(format!(
"Reloaded the config file; {} unsaved change{} kept",
unsaved,
if unsaved == 1 { "" } else { "s" }
));
}
... |
rust_dataset_chunk_510750 | rust_dataset.txt | 510,750 | 512 | self.elements.focused_key().copied();
if let Some(focused) = focused {
self.elements.focus(&focused);
}
}
}
}
pub fn update_plugin_settings_entries(&mut self, entries: Vec<PluginSettingsEntry>) {
self.blocks_screen.set_plugin_setti... |
rust_dataset_chunk_510751 | rust_dataset.txt | 510,751 | 512 |
}
fn label_key_at(&self, line: isize, column: usize) -> Option<SettingKey> {
let (x, _, _, _) = self.rows_area?;
if !self.showing_rows()
|| column < x
|| column >= x + self.label_width
|| crate::page::under_overlay(line, column)
{
return N... |
rust_dataset_chunk_510752 | rust_dataset.txt | 510,752 | 512 | Press Enter or click it to open, and Esc to come back here.",
page.title().to_lowercase()
))],
);
}
let info = describe(key);
let text = setting_help(key)
.filter(|help| !help.trim().is_empty())
.unwrap_or(info.description)... |
rust_dataset_chunk_510753 | rust_dataset.txt | 510,753 | 512 | lines.push(Text::from("")),
HelpLine::Text(text) => {
for wrapped in wrap(&text, inner) {
lines.push(Text::from(truncate(&wrapped, inner)));
}
},
HelpLine::Warning(text) => {
for wrapped ... |
rust_dataset_chunk_510754 | rust_dataset.txt | 510,754 | 512 | ;
}
let keys_content = focus == Focus::Content && self.showing_keys_screen();
self.keys_screen
.set_focused(keys_content && !self.bindings_focused);
self.keybindings_screen
.set_focused(keys_content && self.bindings_focused);
let page_focused = focus == Fo... |
rust_dataset_chunk_510755 | rust_dataset.txt | 510,755 | 512 | .focus != Focus::Content
|| self.elements.focused_key().copied() != self.editing)
{
self.stop_editing(false);
}
}
pub fn take_setup_request(&mut self) -> bool {
std::mem::replace(&mut self.setup_requested, false)
}
pub fn handle_key(&mut self, key: Key... |
rust_dataset_chunk_510756 | rust_dataset.txt | 510,756 | 512 | _keys_screen() {
self.handle_keys_screen_key(key, keys_capture)
} else if self.showing_page() {
self.handle_page_key(key)
} else {
self.handle_content_key(key)
}
},
}
}
fn handle_menu_... |
rust_dataset_chunk_510757 | rust_dataset.txt | 510,757 | 512 | );
let moves_back = is_shift_tab(&key);
let should_render = self.keys_screen.handle_key(key);
if !keys_capture && !should_render {
if moves_down {
self.enter_bindings();
return true;
}
if moves_back {
self.go_bac... |
rust_dataset_chunk_510758 | rust_dataset.txt | 510,758 | 512 | _plain_key(&key, BareKey::Tab)
|| is_shift_tab(&key)
{
self.go_back();
} else if is_plain_key(&key, BareKey::Char('/')) {
self.open_search();
} else if is_plain_key(&key, BareKey::Esc) {
self.close_or_go_back();
} else {
return ... |
rust_dataset_chunk_510759 | rust_dataset.txt | 510,759 | 512 | ocus::Search);
} else {
self.go_back();
}
} else if is_plain_key(&key, BareKey::Char('/')) {
self.open_search();
} else if is_plain_key(&key, BareKey::Char('r')) {
self.revert_focused();
} else if is_plain_key(&key, BareKey::Esc) {
... |
rust_dataset_chunk_510760 | rust_dataset.txt | 510,760 | 512 | (UiValue::Text(text)) => {
if let SettingKind::Text(check) = describe(key).kind {
if let Err(error) = check_text(check, &text) {
if !text.is_empty() {
self.notice = Some(format!("{}: {}", describe(key).name, error));
... |
rust_dataset_chunk_510761 | rust_dataset.txt | 510,761 | 512 | self.refresh();
true
}
pub fn handle_mouse(&mut self, mouse: Mouse) -> bool {
let should_render = self.handle_mouse_inner(mouse);
self.stop_editing_if_focus_moved();
should_render
}
fn rows_accept_input(&self) -> bool {
!self.closing && self.editing.is_non... |
rust_dataset_chunk_510762 | rust_dataset.txt | 510,762 | 512 | .map(|area| area.contains(line, column))
.unwrap_or(false);
self.help_area = None;
if inside || !help.from_hover {
return true;
}
help_changed = true;
}... |
rust_dataset_chunk_510763 | rust_dataset.txt | 510,763 | 512 | _ => {
let response = match self.page() {
Some(page) => page.handle_mouse(mouse),
None => PageResponse::NotHandled,
};
self.collect_page_results();
if response == PageResponse::NotHandled {
... |
rust_dataset_chunk_510764 | rust_dataset.txt | 510,764 | 512 | if !self.elements.has_open_overlay() {
if self.menu.hit_test(line, column) {
let menu_was_focused = self.focus == Focus::Menu && !self.search_active;
let category_before = self.category();
self.menu.handle_mouse(mouse);
... |
rust_dataset_chunk_510765 | rust_dataset.txt | 510,765 | 512 | SettingKey) -> (String, bool, bool) {
let setting = self.setting(key);
let unsaved = setting.map(|s| s.is_unsaved()).unwrap_or(false);
let set_in_file = setting.map(|s| s.set_in_file).unwrap_or(false);
let mut marker = String::new();
if unsaved {
marker.push_str("● u... |
rust_dataset_chunk_510766 | rust_dataset.txt | 510,766 | 512 | 3),
0,
rows / 2,
None,
None,
);
return;
}
let menu_width = (self
.menu
.items()
.iter()
.map(|item| item.chars().count())
.max()
.unwrap_or(0)
... |
rust_dataset_chunk_510767 | rust_dataset.txt | 510,767 | 512 | let (content_x, content_width) = if full_screen {
(x0, ui_width)
} else {
(x0 + menu_width + 2, ui_width.saturating_sub(menu_width + 2))
};
self.elements.clear_areas();
let showing_keys_screen = self.showing_keys_screen();
let showing_page = self.showing_... |
rust_dataset_chunk_510768 | rust_dataset.txt | 510,768 | 512 | 2 <= height {
let hint_y = y + natural + 1;
print_text_with_coordinates(
Text::from(truncate(
"Keybindings ↓ (Tab past the last field, or click here)",
width,
))
.color_range(2, .... |
rust_dataset_chunk_510769 | rust_dataset.txt | 510,769 | 512 | line, _)| line),
_ => None,
};
let at = |row: Option<usize>| match (row, line) {
(Some(row), Some(line)) => line == row as isize,
_ => false,
};
if !bindings_busy && matches!(mouse, Mouse::LeftClick(..)) {
if at(self.keys_summary_y) || at(s... |
rust_dataset_chunk_510770 | rust_dataset.txt | 510,770 | 512 | }
let mut marker = Text::from("●").color_all(1);
if index == self.menu.selected_index() || self.menu.hovered_index() == Some(index) {
marker = marker.selected();
}
print_text_with_coordinates(marker, column, first_line + index - offset, None, None);
... |
rust_dataset_chunk_510771 | rust_dataset.txt | 510,771 | 512 | 2, None, None);
match self.header_file() {
Some(path) => {
print_text_with_coordinates(Text::from(FILE_PREFIX), x, y, None, None);
let prefix_width = zellij_tile::graphemes::display_width(FILE_PREFIX);
let link_x = x + prefix_width;
le... |
rust_dataset_chunk_510772 | rust_dataset.txt | 510,772 | 512 | _at(&self, line: isize, column: usize) -> bool {
self.file_link_area
.map(|area| area.contains(line, column))
.unwrap_or(false)
}
fn focused_description(&self) -> Option<String> {
if self.focus != Focus::Content || self.showing_keys_screen() || self.showing_page() {
... |
rust_dataset_chunk_510773 | rust_dataset.txt | 510,773 | 512 | , None);
}
return;
}
if self.showing_keys_screen() {
if let Some(notice) = self.notice.as_ref().or(self.keys_screen.notice()) {
print_text_with_coordinates(
Text::from(truncate(notice, cols)).color_all(3),
x,
... |
rust_dataset_chunk_510774 | rust_dataset.txt | 510,774 | 512 | "close"),
],
Focus::Content => &[
("<↓↑>", "move"),
("<Space>", "change"),
("<?>", "help"),
("<r>", "revert"),
("<←>", "categories"),
("</>", "search"),
("<Esc>", "close"),
... |
rust_dataset_chunk_510775 | rust_dataset.txt | 510,775 | 512 | Row::Link(page) => {
if let (Some(screen_y), Some(key)) =
(self.scroll.screen_row(start), page.link_key())
{
if let Some(Element::Button(button)) = self.elements.get_mut(&key) {
button.render(x, screen_y... |
rust_dataset_chunk_510776 | rust_dataset.txt | 510,776 | 512 | usize,
x: usize,
width: usize,
value_width: usize,
widest_marker: usize,
) {
let Some(screen_y) = self.scroll.screen_row(start) else {
return;
};
let (marker, unsaved, is_default) = self.marker_for(key);
let label_width = self.label_width(... |
rust_dataset_chunk_510777 | rust_dataset.txt | 510,777 | 512 | ".chars().count();
marker_text = marker_text.color_range(1, ..unsaved_len);
} else if is_default {
let default_len = "○ default".chars().count();
marker_text = marker_text.dim_range(..default_len);
}
if self.active_danger(key).is_some()... |
rust_dataset_chunk_510778 | rust_dataset.txt | 510,778 | 512 | ().widget().is_disabled()
}
#[test]
fn turning_attention_off_grays_out_the_other_attention_and_notification_settings() {
let mut screen = screen_with(&[(SettingKey::AttentionEnabled, "false")], &[]);
screen.open_at(Category::Attention);
assert!(!is_disabled(&screen, SettingKey::Atte... |
rust_dataset_chunk_510779 | rust_dataset.txt | 510,779 | 512 | vka Term")],
&["Iosevka Term"],
);
assert_eq!(
choice_of(&screen, SettingKey::TerminalFontItalic).1,
"Iosevka Term"
);
assert_eq!(
choice_of(&screen, SettingKey::TerminalFontBold).1,
SAME_AS_FONT
);
}
#[test]
... |
rust_dataset_chunk_510780 | rust_dataset.txt | 510,780 | 512 | [(SettingKey::TerminalFont, "Iosevka Term")], &[]);
match unlisted.build_element(SettingKey::TerminalFont) {
Some(Element::TextInput(input)) => assert_eq!(input.get_text(), "Iosevka Term"),
other => panic!("the font was shown as {:?}", other),
}
}
#[test]
fn a_zero_i... |
rust_dataset_chunk_510781 | rust_dataset.txt | 510,781 | 512 | pper_value(SettingKey::TerminalPaddingLeft), 40);
let screen = screen_with(&[], &[]);
assert_eq!(screen.stepper_value(SettingKey::TerminalPaddingTop), 0);
}
#[test]
fn a_colour_setting_draws_a_sample_beside_its_value() {
assert_eq!(
colour_swatch(Some("#ff8000"), 10, 4).... |
rust_dataset_chunk_510782 | rust_dataset.txt | 510,782 | 512 | ows_the_config_file_text_and_the_facts_of_a_setting() {
let screen = rendered_screen();
let (title, lines) = screen.help_content(SettingKey::OnForceClose);
assert_eq!(title, describe(SettingKey::OnForceClose).name);
assert!(lines
.iter()
.any(|line| matches!(line,... |
rust_dataset_chunk_510783 | rust_dataset.txt | 510,783 | 512 | ),
FileChangeReaction::Ignore
);
}
fn last_prompt(screen: &SettingsScreen) -> (u64, DialogPurpose) {
*screen.pending_prompts.last().expect("a prompt was asked")
}
fn chosen(choice: &str) -> PromptResult {
PromptResult::Answered(PromptValue::Choice(choice.to_owned())... |
rust_dataset_chunk_510784 | rust_dataset.txt | 510,784 | 512 | : &str = "Confirm to replace it.";
const BUTTON_GAP: usize = 3;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum Step {
Choose,
Keys,
Applying,
Result,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
enum Line {
Copy,
Entry,
Terminal,
}
impl Line {
const ALL: [Line; 3... |
rust_dataset_chunk_510785 | rust_dataset.txt | 510,785 | 512 | (&self) -> usize {
zellij_tile::graphemes::display_width(&self.text())
}
}
fn button_rows(buttons: &[Button], width: usize) -> Vec<Vec<usize>> {
let mut rows: Vec<Vec<usize>> = vec![];
let mut used = 0;
for (index, button) in buttons.iter().enumerate() {
let needed = button.width();
... |
rust_dataset_chunk_510786 | rust_dataset.txt | 510,786 | 512 | (None, true) => "the Start menu entry".to_owned(),
(None, false) => "the desktop entry".to_owned(),
}
}
fn capitalized(&self) -> String {
match (&self.app, self.windows) {
(Some(app), _) => app.clone(),
(None, true) => "The Start menu entry".to_owned(),
... |
rust_dataset_chunk_510787 | rust_dataset.txt | 510,787 | 512 | _offer: None,
own_plugin_id,
uninstall_prompt: None,
uninstalling: false,
notice: None,
widened: false,
};
screen.retitle();
request_desktop_integration(&Request::Status);
screen
}
fn retitle(&self) {
let title ... |
rust_dataset_chunk_510788 | rust_dataset.txt | 510,788 | 512 | .status.as_ref() else {
return vec![];
};
self.removable_entry_items()
.into_iter()
.filter_map(|item| status.item(item))
.flat_map(|item| item.removes.clone())
.collect()
}
fn upgrade(&self) -> Option<&Upgrade> {
self.upgrade_... |
rust_dataset_chunk_510789 | rust_dataset.txt | 510,789 | 512 | line == Line::Copy && self.upgrade().map(|u| u.same_version).unwrap_or(false) {
return false;
}
line.ticked_by_default()
}
fn copy_needed(&self) -> bool {
self.visible_lines().contains(&Line::Copy) && !self.line_done(Line::Copy)
}
fn any_done(&self) -> bool {
... |
rust_dataset_chunk_510790 | rust_dataset.txt | 510,790 | 512 | _applying();
}
},
}
true
}
pub fn config_written(&mut self) -> bool {
if self.waiting_for_config {
self.waiting_for_config = false;
self.config_result = Some(Ok(()));
self.maybe_finish_applying();
return true;
... |
rust_dataset_chunk_510791 | rust_dataset.txt | 510,791 | 512 | self.visible_lines()
.into_iter()
.filter(|line| self.ticked.contains(line) && !self.line_done(*line))
.flat_map(|line| self.offered(line))
.filter(|status| !status.installed)
.map(|status| status.item)
.collect()
}
fn ask_to_uninstall(&m... |
rust_dataset_chunk_510792 | rust_dataset.txt | 510,792 | 512 | Request::Apply {
install,
remove: vec![],
overwrite_binary: false,
});
}
self.step = Step::Applying;
self.retitle();
self.maybe_finish_applying();
}
fn replace_binary(&mut self) {
self.replace_offer = None;
... |
rust_dataset_chunk_510793 | rust_dataset.txt | 510,793 | 512 | self.info_emphasis(topic) {
message = message.color_substring(0, emphasized);
}
prompt(PromptRequest::info(self.info_title(topic), message).placement(placement));
}
fn info_emphasis(&self, topic: Topic) -> Vec<String> {
match topic {
Topic::Line(Line::Copy) => m... |
rust_dataset_chunk_510794 | rust_dataset.txt | 510,794 | 512 | ) => match self.upgrade() {
Some(upgrade) if upgrade.same_version => {
paragraphs.push(format!(
"A different build of Zellij {} is already at {}. Checking this replaces it with the build you are running now.",
upgrade.to,
... |
rust_dataset_chunk_510795 | rust_dataset.txt | 510,795 | 512 | .",
_ => "Adds an \"Open Zellij here\" item when you right-click a folder or a drive in Explorer.",
}
.to_owned(),
);
} else {
paragraphs.push("Adds Zellij to your app menu, so it opens in... |
rust_dataset_chunk_510796 | rust_dataset.txt | 510,796 | 512 | ;
if let Some(row) = self.focusable.get(self.focus).copied() {
self.activate(row);
}
},
BareKey::Char('?') if self.step == Step::Choose => {
self.show_focus = true;
if let Some(topic) = self.focusable.get(self.fo... |
rust_dataset_chunk_510797 | rust_dataset.txt | 510,797 | 512 | (y, start, end, _)| *y == line && column >= *start && column < *end)
.map(|(_, _, _, row)| *row);
if let Some(row) = hit {
if let Some(position) = self.focusable.iter().position(|r| *r == row) {
self.focus = position;
}
self... |
rust_dataset_chunk_510798 | rust_dataset.txt | 510,798 | 512 | ::from("Applying your choices…").color_all(2),
)],
_ => self.choose_blocks(width),
};
let footer = match blocks.last() {
Some(Block::Buttons(_)) => blocks.pop(),
_ => None,
};
self.focusable = blocks
.iter()
.filter_... |
rust_dataset_chunk_510799 | rust_dataset.txt | 510,799 | 512 | .can_uninstall() => {
"<↓↑> move · <Space> tick · <?> more · <Del> uninstall"
},
Step::Choose => "<↓↑> move · <Space> tick · <?> more",
_ => "",
};
print_text_with_coordinates(
Text::from(truncate(help, cols)).dim_all(),
0,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.