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_518000 | rust_dataset.txt | 518,000 | 512 | _1, plugin_2, or 3)
#[clap(short, long, value_parser)]
pane_id: Option<String>,
},
/// Rotate the location of the previous pane backwards
MovePaneBackwards {
/// Target a specific pane by ID (eg. terminal_1, plugin_2, or 3)
#[clap(short, long, value_parser)]
pane_id: ... |
rust_dataset_chunk_518001 | rust_dataset.txt | 518,001 | 512 | 3)
#[clap(short, long, value_parser)]
pane_id: Option<String>,
},
/// Scroll down to bottom in focus pane.
ScrollToBottom {
/// Target a specific pane by ID (eg. terminal_1, plugin_2, or 3)
#[clap(short, long, value_parser)]
pane_id: Option<String>,
},
/// Sc... |
rust_dataset_chunk_518002 | rust_dataset.txt | 518,002 | 512 | <String>,
},
/// Toggle frames around panes in the UI
TogglePaneFrames,
/// Switch the focused stack between showing its titles in a column (vertical) and in a row
/// (horizontal)
ToggleStackListOrientation {
#[clap(
short,
long,
value_parser,
... |
rust_dataset_chunk_518003 | rust_dataset.txt | 518,003 | 512 | : Option<PathBuf>,
/// Open the new pane in floating mode
#[clap(short, long)]
floating: bool,
/// Open the new pane in place of the current pane, temporarily suspending it
#[clap(short, long, conflicts_with("floating"), conflicts_with("direction"))]
in_place: bool,
... |
rust_dataset_chunk_518004 | rust_dataset.txt | 518,004 | 512 | is floating as a bare integer (eg. 1) or percent (eg. 10%)
#[clap(long, requires("floating"))]
height: Option<String>,
/// Whether to pin a floating pane so that it is always on top
#[clap(long, requires("floating"))]
pinned: Option<bool>,
#[clap(long, conflicts_with("fl... |
rust_dataset_chunk_518005 | rust_dataset.txt | 518,005 | 512 | double,left:single,rounded"
#[clap(long, value_parser)]
border_style: Option<String>,
},
/// Open the specified file in a new zellij pane with your default EDITOR
/// Returns: Created pane ID (format: terminal_<id>)
Edit {
file: PathBuf,
/// Direction to open the new pan... |
rust_dataset_chunk_518006 | rust_dataset.txt | 518,006 | 512 | _pane: bool,
#[clap(
long,
help = "if set, will open the pane without changing the focus of any client, placing it relative to the pane the command was issued from"
)]
no_focus: bool,
/// start this pane without a border (warning: will make it impossible to move w... |
rust_dataset_chunk_518007 | rust_dataset.txt | 518,007 | 512 | " to stdout and exits 0 if visible.
/// Prints "false" to stdout and exits 1 if not visible.
AreFloatingPanesVisible {
#[clap(short, long, value_parser)]
tab_id: Option<usize>,
},
/// Close the focused pane.
ClosePane {
/// Target a specific pane by ID (eg. terminal_1, plugin... |
rust_dataset_chunk_518008 | rust_dataset.txt | 518,008 | 512 | TabById {
id: u64,
},
/// Rename tab by stable ID
RenameTabById {
id: u64,
name: String,
},
/// Create a new tab, optionally with a specified tab layout and name
///
/// Returns: The created tab's ID as a single number on stdout
NewTab {
/// Layout to use ... |
rust_dataset_chunk_518009 | rust_dataset.txt | 518,009 | 512 | exit status) OR its pane has been closed
#[clap(
long,
requires("initial_command"),
conflicts_with("block_until_exit_success"),
conflicts_with("block_until_exit_failure")
)]
block_until_exit: bool,
#[clap(
long,
he... |
rust_dataset_chunk_518010 | rust_dataset.txt | 518,010 | 512 | clap(long, value_parser, conflicts_with = "layout")]
layout_string: Option<String>,
/// Default folder to look for layouts
#[clap(long, value_parser)]
layout_dir: Option<PathBuf>,
/// Retain existing terminal panes that do not fit in the layout (default: false)
#[clap(l... |
rust_dataset_chunk_518011 | rust_dataset.txt | 518,011 | 512 | <PluginUserConfiguration>,
#[clap(short, long, value_parser)]
skip_plugin_cache: bool,
#[clap(
long,
help = "if set, will open the plugin pane without changing the focus of any client"
)]
no_focus: bool,
/// Target a specific tab by ID
#[cl... |
rust_dataset_chunk_518012 | rust_dataset.txt | 518,012 | 512 | clap(short('l'), long, display_order(5))]
force_launch_plugin: bool,
/// If launching a new plugin, skip cache and force-compile the plugin
#[clap(short('s'), long, display_order(6))]
skip_plugin_cache: bool,
/// If launching a plugin, should it be floating or not, defaults to fl... |
rust_dataset_chunk_518013 | rust_dataset.txt | 518,013 | 512 | it) or close (close the popup) (e.g. --popup mouse --popup-outside-click close)"
)]
popup_outside_click: Option<crate::data::OutsideClick>,
},
ListClients,
/// List all panes in the current session
///
/// Returns: Formatted list of panes (table or JSON) to stdout
ListPanes {
... |
rust_dataset_chunk_518014 | rust_dataset.txt | 518,014 | 512 | #[clap(short, long, value_parser)]
pane_id: Option<String>,
},
#[clap(
about = "Toggle whether the live view in the focused plugin pane resizes the program of the pane it shows"
)]
ToggleMirrorResize,
#[clap(about = "Mute or unmute the attention status of a pane (the focused pane by... |
rust_dataset_chunk_518015 | rust_dataset.txt | 518,015 | 512 | )]
GoToNextAttention,
#[clap(
about = "Show or hide the desktop app's tray / menu-bar icon until the app restarts (sessions and notifications continue)"
)]
ToggleTrayIcon,
#[clap(about = "Mark a pane as seen, clearing past events (the focused pane by default)")]
MarkPaneSeen {
... |
rust_dataset_chunk_518016 | rust_dataset.txt | 518,016 | 512 | %)
#[clap(long)]
height: Option<String>,
/// Whether to pin a floating pane so that it is always on top
#[clap(long)]
pinned: Option<bool>,
/// change this pane to be with/without a border (warning: will make it impossible to move with the
/// mouse if without a b... |
rust_dataset_chunk_518017 | rust_dataset.txt | 518,017 | 512 | ")]
OpenContextMenu,
/// Switch to a different session
SwitchSession {
/// Name of the session to switch to
name: String,
/// Optional tab position to focus
#[clap(long)]
tab_position: Option<usize>,
/// Optional pane ID to focus (eg. "terminal_1" for terminal... |
rust_dataset_chunk_518018 | rust_dataset.txt | 518,018 | 512 | closed.
SetResurrectCommand {
/// The pane_id of the terminal pane, eg. terminal_1 or 3 (equivalent to terminal_3).
/// Defaults to $ZELLIJ_PANE_ID if not provided.
#[clap(short, long, value_parser)]
pane_id: Option<String>,
/// Working directory to resurrect the pane in
... |
rust_dataset_chunk_518019 | rust_dataset.txt | 518,019 | 512 | back, Some(0));
}
#[test]
fn subscribe_scrollback_with_value() {
let s = parse_subscribe(&[
"subscribe",
"--pane-id",
"terminal_1",
"--scrollback",
"100",
]);
assert_eq!(s.scrollback, Some(100));
}
#[test]
fn s... |
rust_dataset_chunk_518020 | rust_dataset.txt | 518,020 | 512 | ]);
assert_eq!(
e.event_types,
vec![
CliEventType::PaneFocused,
CliEventType::TabCreated,
CliEventType::ModeChanged
]
);
assert_eq!(e.pane_id, vec!["terminal_1".to_string()]);
assert_eq!(e.tab_id, vec![2... |
rust_dataset_chunk_518021 | rust_dataset.txt | 518,021 | 512 | !(parse_set_resurrect_command(&["--clear", "--cwd", "/tmp"]).is_err());
}
#[test]
fn set_resurrect_command_requires_command_or_clear() {
assert!(parse_set_resurrect_command(&[]).is_err());
}
}
--- FILE: zellij/zellij-utils/src/common_path.rs ---
// The following license refers to code in this... |
rust_dataset_chunk_518022 | rust_dataset.txt | 518,022 | 512 | to_path_buf());
/// # }
/// ```
pub fn common_path_all<'a>(paths: impl IntoIterator<Item = &'a Path>) -> Option<PathBuf> {
let mut path_iter = paths.into_iter();
let mut result = path_iter.next()?.to_path_buf();
for path in path_iter {
if let Some(r) = common_path(&result, &path) {
resul... |
rust_dataset_chunk_518023 | rust_dataset.txt | 518,023 | 512 | ],
vec![three, two, one],
];
for all in path_permutations {
assert_eq!(common_path_all(all).unwrap(), result.to_path_buf())
}
}
#[test]
fn compare_paths() {
let one = Path::new("/foo/bar/baz/one.txt");
let two = Path::new("/foo/bar/quux/quuux/... |
rust_dataset_chunk_518024 | rust_dataset.txt | 518,024 | 512 | pub const DEFAULT_LIGHT_THEME_NAME: &str = "default-light";
pub const CLIENT_SERVER_CONTRACT_VERSION: usize = 1;
// The session-info cache is keyed by session id (a short random id for new sessions,
// or the session name for sessions from before ids), NOT the user-visible
// display name — so renaming a session neve... |
rust_dataset_chunk_518025 | rust_dataset.txt | 518,025 | 512 | let is_empty = std::fs::read_dir(&path)
.ok()
.map_or(false, |mut iter| iter.next().is_none());
if is_empty {
if let Err(e) = std::fs::remove_dir(&path) {
if e.kind() != std::io::ErrorKind::NotFound {
log::debug!("Failed to prune empty ses... |
rust_dataset_chunk_518026 | rust_dataset.txt | 518,026 | 512 | &[&str] = &[
#[cfg(feature = "disable_automatic_asset_installation")]
"disable_automatic_asset_installation",
];
#[cfg(unix)]
pub fn is_ipc_socket(file_type: &std::fs::FileType) -> bool {
use std::os::unix::fs::FileTypeExt;
file_type.is_socket()
}
#[cfg(not(unix))]
pub fn is_ipc_socket(file_type: &st... |
rust_dataset_chunk_518027 | rust_dataset.txt | 518,027 | 512 | , std::process::id().to_string())?;
Ok(listener)
}
#[cfg(unix)]
pub fn ipc_bind_async(
path: &std::path::Path,
) -> std::io::Result<interprocess::local_socket::tokio::Listener> {
use interprocess::local_socket::{prelude::*, GenericFilePath, ListenerOptions};
let fs_name = path.to_fs_name::<GenericFileP... |
rust_dataset_chunk_518028 | rust_dataset.txt | 518,028 | 512 | ?)
.create_sync()
}
// Kept short: macOS limits socket paths to 104 bytes, and the temp dir already uses about half.
pub const APP_DIR_NAME: &str = ".desk";
pub const APP_CONTROL_SOCKET_NAME: &str = "control";
pub const APP_ATTENTION_SOCKET_NAME: &str = "attention";
pub const APP_LOCK_FILE_NAME: &str = "lock";... |
rust_dataset_chunk_518029 | rust_dataset.txt | 518,029 | 512 | _all(dir)?;
crate::shared::set_permissions(dir, 0o700)
}
#[cfg(unix)]
pub use unix_only::*;
#[cfg(unix)]
mod unix_only {
use super::*;
use crate::envs;
pub use crate::shared::set_permissions;
use lazy_static::lazy_static;
use nix::unistd::Uid;
use std::env::temp_dir;
// Maximum sockad... |
rust_dataset_chunk_518030 | rust_dataset.txt | 518,030 | 512 | use crate::shared::set_permissions;
#[cfg(windows)]
use dunce;
use lazy_static::lazy_static;
use std::env::temp_dir;
#[cfg(windows)]
fn canonicalize_path(path: PathBuf) -> PathBuf {
dunce::canonicalize(&path).unwrap_or(path)
}
#[cfg(not(windows))]
fn canonicalize_path(path... |
rust_dataset_chunk_518031 | rust_dataset.txt | 518,031 | 512 | ));
ipc_dir.push(CLIENT_SERVER_CONTRACT_DIR.clone());
ipc_dir
};
pub static ref WEBSERVER_SOCKET_PATH: PathBuf = ZELLIJ_SOCK_DIR.join("web_server_bus");
}
}
#[cfg(test)]
mod app_dir_tests {
use super::*;
use std::path::Path;
#[test]
fn every_desk... |
rust_dataset_chunk_518032 | rust_dataset.txt | 518,032 | 512 | .map(|t| is_ipc_socket(&t))
.unwrap_or(false)
})
.collect();
assert!(listed.is_empty());
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
let mode = std::fs::metadata(app_dir_in(dir.path()))
... |
rust_dataset_chunk_518033 | rust_dataset.txt | 518,033 | 512 | _width::UnicodeWidthChar;
#[cfg(not(target_family = "wasm"))]
use crate::vendored::termwiz::input::{KeyCode, KeyCodeEncodeModes, KeyboardEncoding, Modifiers};
pub type ClientId = u32;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum UnblockCondition {
/// Unblock only when exit statu... |
rust_dataset_chunk_518034 | rust_dataset.txt | 518,034 | 512 | <(PaletteColor, PaletteColor)> {
client_slot_to_colors(client_id as usize, colors)
}
pub fn single_client_color(colors: Palette) -> (PaletteColor, PaletteColor) {
(colors.green, colors.black)
}
impl FromStr for KeyWithModifier {
type Err = Box<dyn std::error::Error>;
fn from_str(key_str: &str) -> Resu... |
rust_dataset_chunk_518035 | rust_dataset.txt | 518,035 | 512 | BareKey::Char(character) if character.is_ascii_uppercase() => {
let mut to_hash = self.clone();
to_hash.bare_key = BareKey::Char(character.to_ascii_lowercase());
to_hash.key_modifiers.insert(KeyModifier::Shift);
to_hash.bare_key.hash(state);
... |
rust_dataset_chunk_518036 | rust_dataset.txt | 518,036 | 512 | f, "→"),
BareKey::Home => write!(f, "HOME"),
BareKey::End => write!(f, "END"),
BareKey::Backspace => write!(f, "BACKSPACE"),
BareKey::Delete => write!(f, "DEL"),
BareKey::Insert => write!(f, "INS"),
BareKey::F(index) => write!(f, "F{}", index),
... |
rust_dataset_chunk_518037 | rust_dataset.txt | 518,037 | 512 | 4)),
"f5" => Ok(BareKey::F(5)),
"f6" => Ok(BareKey::F(6)),
"f7" => Ok(BareKey::F(7)),
"f8" => Ok(BareKey::F(8)),
"f9" => Ok(BareKey::F(9)),
"f10" => Ok(BareKey::F(10)),
"f11" => Ok(BareKey::F(11)),
"f12" => Ok(BareKey::F(12)... |
rust_dataset_chunk_518038 | rust_dataset.txt | 518,038 | 512 | Ok("13") => Some(BareKey::Enter),
Ok("9") => Some(BareKey::Tab),
Ok("127") => Some(BareKey::Backspace),
Ok("57358") => Some(BareKey::CapsLock),
Ok("57359") => Some(BareKey::ScrollLock),
Ok("57360") => Some(BareKey::NumLock),
Ok("57361") => Some(Ba... |
rust_dataset_chunk_518039 | rust_dataset.txt | 518,039 | 512 | Some(BareKey::Insert),
Ok("57426") => Some(BareKey::Delete),
Ok(num) => u32::from_str_radix(num, 10)
.ok()
.and_then(char::from_u32)
.map(BareKey::Char),
_ => None,
}
}
pub fn from_bytes_with_tilde(bytes: &[u8]) -> Opti... |
rust_dataset_chunk_518040 | rust_dataset.txt | 518,040 | 512 | ),
Ok("1P") | Ok("P") => Some(BareKey::F(1)),
Ok("1Q") | Ok("Q") => Some(BareKey::F(2)),
Ok("1S") | Ok("S") => Some(BareKey::F(4)),
_ => None,
}
}
}
bitflags::bitflags! {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
struct ModifierFlags: u8 {
... |
rust_dataset_chunk_518041 | rust_dataset.txt | 518,041 | 512 | (bare_key: BareKey) -> Self {
KeyWithModifier {
bare_key,
key_modifiers: BTreeSet::new(),
}
}
pub fn new_with_modifiers(bare_key: BareKey, key_modifiers: BTreeSet<KeyModifier>) -> Self {
KeyWithModifier {
bare_key,
key_modifiers,
}
... |
rust_dataset_chunk_518042 | rust_dataset.txt | 518,042 | 512 | })
},
_ => None,
}
}
pub fn strip_common_modifiers(&self, common_modifiers: &Vec<KeyModifier>) -> Self {
let common_modifiers: BTreeSet<&KeyModifier> = common_modifiers.into_iter().collect();
KeyWithModifier {
bare_key: self.bare_key.clone(),
... |
rust_dataset_chunk_518043 | rust_dataset.txt | 518,043 | 512 | UpArrow,
BareKey::Right => KeyCode::RightArrow,
BareKey::Home => KeyCode::Home,
BareKey::End => KeyCode::End,
BareKey::Backspace => KeyCode::Backspace,
BareKey::Delete => KeyCode::Delete,
BareKey::Insert => KeyCode::Insert,
BareKey::F(i... |
rust_dataset_chunk_518044 | rust_dataset.txt | 518,044 | 512 | {
format!("\u{1b}[{}u", code)
}
};
let csi_letter = |letter: char| {
if mods > 1 {
format!("\u{1b}[1;{}{}", mods, letter)
} else {
format!("\u{1b}[{}", letter)
}
};
let ss3_or_csi_letter = |l... |
rust_dataset_chunk_518045 | rust_dataset.txt | 518,045 | 512 | (1) => ss3_or_csi_letter('P'),
BareKey::F(2) => ss3_or_csi_letter('Q'),
BareKey::F(3) => csi_tilde(13),
BareKey::F(4) => ss3_or_csi_letter('S'),
BareKey::F(5) => csi_tilde(15),
BareKey::F(6) => csi_tilde(17),
BareKey::F(7) => csi_tilde(18),
... |
rust_dataset_chunk_518046 | rust_dataset.txt | 518,046 | 512 | Clone, Copy, Debug, PartialEq, Hash, Deserialize, Serialize, PartialOrd, Ord)]
pub enum Direction {
Left,
Right,
Up,
Down,
}
impl Default for Direction {
fn default() -> Self {
Direction::Left
}
}
impl Direction {
pub fn invert(&self) -> Direction {
match *self {
... |
rust_dataset_chunk_518047 | rust_dataset.txt | 518,047 | 512 | Resize::Decrease => write!(f, "-"),
}
}
}
impl FromStr for Resize {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"Increase" | "increase" | "+" => Ok(Resize::Increase),
"Decrease" | "decrease" | "-" => Ok(Resize::Decrease),
... |
rust_dataset_chunk_518048 | rust_dataset.txt | 518,048 | 512 | Resize::Increase => Resize::Decrease,
Resize::Decrease => Resize::Increase,
};
let direction = match self.direction {
Some(direction) => Some(direction.invert()),
None => None,
};
ResizeStrategy::new(resize, direction)
}
pub fn resize_type(&... |
rust_dataset_chunk_518049 | rust_dataset.txt | 518,049 | 512 | fn move_all_borders_in(&self) -> bool {
(self.resize == Resize::Decrease) && (self.direction == None)
}
}
impl fmt::Display for ResizeStrategy {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let resize = match self.resize {
Resize::Increase => "increase",
R... |
rust_dataset_chunk_518050 | rust_dataset.txt | 518,050 | 512 | Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize, EnumIter,
)]
pub enum MouseButton {
Left,
Right,
Middle,
ScrollUp,
ScrollDown,
ScrollLeft,
ScrollRight,
}
impl MouseButton {
pub fn is_wheel(&self) -> bool {
matches!(
self,
MouseButton:... |
rust_dataset_chunk_518051 | rust_dataset.txt | 518,051 | 512 | TreeSet<KeyModifier>) -> Self {
self.modifiers = modifiers;
self
}
pub fn with_click_count(mut self, click_count: u8) -> Self {
self.click_count = click_count;
self
}
pub fn with_target(mut self, target: MouseTarget) -> Self {
self.target = target;
self
... |
rust_dataset_chunk_518052 | rust_dataset.txt | 518,052 | 512 | _owned()),
_ => {},
}
parts.push(self.button.name().to_owned());
parts.join(" ")
}
pub fn same_trigger_ignoring_target(&self, other: &MouseTrigger) -> bool {
self.button == other.button
&& self.modifiers == other.modifiers
&& self.click_count =... |
rust_dataset_chunk_518053 | rust_dataset.txt | 518,053 | 512 | #[non_exhaustive]
pub enum Event {
ModeUpdate(ModeInfo),
TabUpdate(Vec<TabInfo>),
PaneUpdate(PaneManifest),
/// A key was pressed while the user is focused on this plugin's pane
Key(KeyWithModifier),
/// A mouse event happened while the user is focused on this plugin's pane
Mouse(Mouse),
... |
rust_dataset_chunk_518054 | rust_dataset.txt | 518,054 | 512 | EditPaneOpened(u32, Context), // u32 - terminal_pane_id
EditPaneExited(u32, Option<i32>, Context), // u32 - terminal_pane_id, Option<i32> - exit code
CommandPaneReRun(u32, Context), // u32 - terminal_pane_id, Option<i32> -
FailedToWriteConfigToDisk(Option<String>), // String -> the ... |
rust_dataset_chunk_518055 | rust_dataset.txt | 518,055 | 512 | Id,
session_path: Vec<String>,
mode: InputMode,
base_mode: Option<InputMode>,
keybinds_generation: u64,
},
NestedSessionEnded {
pane_id: PaneId,
reason: NestedSessionEndReason,
},
ContextMenu(ContextMenuContext, Vec<ContextMenuEntry>),
ConfigChangesDro... |
rust_dataset_chunk_518056 | rust_dataset.txt | 518,056 | 512 | matching_columns: Vec<String>,
pub script_label: Option<String>,
pub tabs: Vec<SessionPreviewTab>,
pub connected_clients: usize,
}
impl SessionSuggestion {
pub fn column_matches(&self, fact: &str) -> bool {
self.matching_columns.iter().any(|c| c == fact)
}
pub fn fact_value(&self, fact... |
rust_dataset_chunk_518057 | rust_dataset.txt | 518,057 | 512 | pub session_name: String,
pub tab_index: Option<usize>,
pub active_tab_index: Option<usize>,
pub tab_names: Vec<String>,
pub contents: String,
pub pane_count: usize,
pub connected_clients: usize,
pub error: Option<String>,
#[serde(default)]
pub tabs: Vec<SessionPreviewTab>,
#[se... |
rust_dataset_chunk_518058 | rust_dataset.txt | 518,058 | 512 | _CLIENT_ID_ARG: &str = "client_id";
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
pub struct SavedSessionPreview {
pub session_name: String,
pub folder: Option<String>,
pub tabs: Vec<SavedTabPreview>,
pub error: Option<String>,
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Ha... |
rust_dataset_chunk_518059 | rust_dataset.txt | 518,059 | 512 | PasteFromClipboard,
ClickedPaneAction::ToggleStackListOrientation,
];
pub fn kdl_name(&self) -> &'static str {
match self {
ClickedPaneAction::CloseFocus => "CloseFocusByPaneId",
ClickedPaneAction::ToggleFocusFullscreen => "ToggleFocusFullscreenByPaneId",
Clic... |
rust_dataset_chunk_518060 | rust_dataset.txt | 518,060 | 512 | PaneAction::ToggleWatch => Action::WatchPaneByPaneId { pane_id },
ClickedPaneAction::HideBar => Action::HideBarByPaneId { pane_id },
ClickedPaneAction::PasteFromClipboard => Action::PasteFromClipboardByPaneId { pane_id },
ClickedPaneAction::ToggleStackListOrientation => {
... |
rust_dataset_chunk_518061 | rust_dataset.txt | 518,061 | 512 | ::Action(action) => Some(action),
ContextMenuAction::ClickedPane(action) => pane_id.map(|id| action.with_pane(id)),
ContextMenuAction::ClickedTab(action) => tab_id.map(|id| action.with_tab(id)),
}
}
pub fn keybinding_equivalent(&self) -> Vec<Action> {
match self {
... |
rust_dataset_chunk_518062 | rust_dataset.txt | 518,062 | 512 | GuestUnresponsive,
GuestGone,
TooLarge,
Timeout,
}
impl fmt::Display for NestedSessionKeybindsError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let description = match self {
NestedSessionKeybindsError::NotANestedSession => "no nested session in this pane",
... |
rust_dataset_chunk_518063 | rust_dataset.txt | 518,063 | 512 | {
PermissionType::ReadApplicationState => {
"Access Zellij state (Panes, Tabs and UI)".to_owned()
},
PermissionType::ChangeApplicationState => {
"Change Zellij state (Panes, Tabs and UI) and run commands".to_owned()
},
Permissi... |
rust_dataset_chunk_518064 | rust_dataset.txt | 518,064 | 512 | except for the shortcuts leading
/// to other modes
#[serde(alias = "normal")]
Normal,
/// In `Locked` mode, input is always written to the terminal and all shortcuts are disabled
/// except the one leading back to normal mode
#[serde(alias = "locked")]
Locked,
/// `Resize` mode allows ... |
rust_dataset_chunk_518065 | rust_dataset.txt | 518,065 | 512 | ue {
ThemeHue::Dark
}
}
impl FromStr for ThemeHue {
type Err = String;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s.trim().to_lowercase().as_str() {
"light" => Ok(ThemeHue::Light),
"dark" => Ok(ThemeHue::Dark),
e => Err(format!(
... |
rust_dataset_chunk_518066 | rust_dataset.txt | 518,066 | 512 | HighlightLayer {
fn default() -> Self {
HighlightLayer::Hint
}
}
/// Style for a plugin-supplied regex highlight.
/// Theme-based variants reference `style.colors.text_unselected.*`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum HighlightStyle {
None, // no color ove... |
rust_dataset_chunk_518067 | rust_dataset.txt | 518,067 | 512 | str) -> Self {
let trimmed = rgb_str.trim();
if !trimmed.starts_with("rgb(") || !trimmed.ends_with(')') {
return Self::default();
}
let inner = trimmed
.strip_prefix("rgb(")
.and_then(|s| s.strip_suffix(')'))
.unwrap_or("");
let ... |
rust_dataset_chunk_518068 | rust_dataset.txt | 518,068 | 512 | #[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub enum PaletteSource {
Default,
Xresources,
}
impl Default for PaletteSource {
fn default() -> PaletteSource {
PaletteSource::Default
}
}
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq, Hash, Default... |
rust_dataset_chunk_518069 | rust_dataset.txt | 518,069 | 512 | _dashed",
s
)),
}
}
}
impl fmt::Display for LineStyle {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let name = match self {
LineStyle::Single => "single",
LineStyle::Double => "double",
LineStyle::Heavy => "heavy",
... |
rust_dataset_chunk_518070 | rust_dataset.txt | 518,070 | 512 | c == '=') {
Some((key, value)) => (key.trim().to_lowercase(), Some(value.trim())),
None => (token.to_lowercase(), None),
};
match (key.as_str(), value) {
("rounded" | "rounded_corners" | "rounded-corners", value) => {
let round... |
rust_dataset_chunk_518071 | rust_dataset.txt | 518,071 | 512 | bottom: parse(bottom)?,
left: parse(left)?,
rounded_corners,
})
}
pub fn apply_to(&self, base: BorderStyle) -> BorderStyle {
let all = self.all;
BorderStyle {
top: self.top.or(all).unwrap_or(base.top),
right: self.right.or(all).unwrap_or(b... |
rust_dataset_chunk_518072 | rust_dataset.txt | 518,072 | 512 | pub exit_code_error: StyleDeclaration,
pub multiplayer_user_colors: MultiplayerColors,
}
#[derive(Debug, Copy, Default, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
pub struct StyleDeclaration {
pub base: PaletteColor,
pub background: PaletteColor,
pub emphasis_0: PaletteColor,
pub emphasi... |
rust_dataset_chunk_518073 | rust_dataset.txt | 518,073 | 512 | ribbon_selected: StyleDeclaration {
base: PaletteColor::Rgb(default_colors::BACKGROUND),
background: PaletteColor::Rgb(default_colors::GREEN),
emphasis_0: PaletteColor::Rgb(default_colors::WINE),
emphasis_1: PaletteColor::Rgb(default_colors::WINE),
emphasis_2: PaletteColor::Rgb(... |
rust_dataset_chunk_518074 | rust_dataset.txt | 518,074 | 512 | Color::Rgb(default_colors::GOLD),
emphasis_1: PaletteColor::Rgb(default_colors::BLUE),
emphasis_2: PaletteColor::Rgb(default_colors::PINK),
emphasis_3: PaletteColor::Rgb(default_colors::ORANGE),
},
frame_highlight: StyleDeclaration {
base: PaletteColor::Rgb(default_colors::GOLD),... |
rust_dataset_chunk_518075 | rust_dataset.txt | 518,075 | 512 | _3: PaletteColor::Rgb(default_colors::VIOLET),
},
list_selected: StyleDeclaration {
base: PaletteColor::Rgb(default_colors::FOREGROUND),
background: PaletteColor::Rgb(default_colors::SURFACE),
emphasis_0: PaletteColor::Rgb(default_colors::ORANGE),
emphasis_1: PaletteColor::Rgb(de... |
rust_dataset_chunk_518076 | rust_dataset.txt | 518,076 | 512 | .list_unselected.background,
purple: styling.multiplayer_user_colors.player_3,
gold: styling.multiplayer_user_colors.player_6,
silver: styling.multiplayer_user_colors.player_8,
pink: styling.multiplayer_user_colors.player_9,
brown: styling.multiplayer_user_col... |
rust_dataset_chunk_518077 | rust_dataset.txt | 518,077 | 512 | ,
emphasis_2: palette.magenta,
emphasis_3: palette.brown,
background: Default::default(),
},
frame_highlight: StyleDeclaration {
base: palette.orange,
emphasis_0: palette.magenta,
emphasis_1: palette.... |
rust_dataset_chunk_518078 | rust_dataset.txt | 518,078 | 512 | for UI bars
#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ModeInfo {
pub mode: InputMode,
pub base_mode: Option<InputMode>,
pub keybinds: KeybindsVec,
pub style: Style,
pub capabilities: PluginCapabilities,
pub session_name: Option<String>,
pub editor: O... |
rust_dataset_chunk_518079 | rust_dataset.txt | 518,079 | 512 | All;
}
let names: BTreeSet<String> = names
.iter()
.map(|name| name.as_ref().trim().to_owned())
.filter(|name| !name.is_empty())
.collect();
if names.is_empty() {
HiddenBars::None
} else {
HiddenBars::Named(names)
... |
rust_dataset_chunk_518080 | rust_dataset.txt | 518,080 | 512 | return Ok(HiddenBars::None);
}
Ok(HiddenBars::from_names(&names))
}
}
impl ModeInfo {
pub fn get_mode_keybinds(&self) -> Vec<(KeyWithModifier, Vec<Action>)> {
self.get_keybinds_for_mode(self.mode)
}
pub fn get_keybinds_for_mode(&self, mode: InputMode) -> Vec<(KeyWit... |
rust_dataset_chunk_518081 | rust_dataset.txt | 518,081 | 512 | pub available_layouts: Vec<LayoutInfo>,
pub plugins: BTreeMap<u32, PluginInfo>,
pub web_clients_allowed: bool,
pub web_client_count: usize,
pub tab_history: BTreeMap<ClientId, Vec<usize>>,
pub pane_history: BTreeMap<ClientId, Vec<PaneId>>,
pub creation_time: Duration,
#[serde(default)]
... |
rust_dataset_chunk_518082 | rust_dataset.txt | 518,082 | 512 | ,
pub active_values: BTreeMap<String, String>,
pub error: Option<String>,
pub set_by_layout: bool,
pub default_mode: Option<InputMode>,
pub set_on_command_line: bool,
}
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
pub struct LayoutWithError {
pub layout_name: String,
pub e... |
rust_dataset_chunk_518083 | rust_dataset.txt | 518,083 | 512 | _and_update_times(path: &PathBuf) -> (String, String) {
// (creation_time, update_time) returns stringified unix epoch
match std::fs::metadata(path) {
Ok(metadata) => {
let creation_time = metadata
.created()
.ok()
.... |
rust_dataset_chunk_518084 | rust_dataset.txt | 518,084 | 512 | iledPaneLayout) -> Self {
let mut is_plugin = false;
let mut is_builtin_plugin = false;
// Try to get the name from the pane's name field first
let name = if let Some(ref name) = pane.name {
Some(name.clone())
} else if let Some(ref run) = pane.run {
// I... |
rust_dataset_chunk_518085 | rust_dataset.txt | 518,085 | 512 | _string())
},
Run::Cwd(_) => None,
}
} else {
None
};
PaneMetadata {
name,
is_plugin,
is_builtin_plugin,
}
}
}
// Helper function to recursively collect leaf panes from TiledPaneLayout
fn co... |
rust_dataset_chunk_518086 | rust_dataset.txt | 518,086 | 512 | count() > 1 {
let layout_dir = cwd;
let file_path = layout_dir.join(layout_path);
Some(LayoutInfo::File(
// layout_dir.join(layout_path).display().to_string(),
file_path.display().to_string(),
LayoutMetadata::from(&file_path),
... |
rust_dataset_chunk_518087 | rust_dataset.txt | 518,087 | 512 | (|l| l.clone())
.or_else(default_layout_dir)
else {
return None;
};
let file_path = layout_dir.join(layout_path);
Some(LayoutInfo::File(
// layout_dir.join(layout_path).display().to_string(),
file_path.displa... |
rust_dataset_chunk_518088 | rust_dataset.txt | 518,088 | 512 | (plugin_id, run_plugin.into());
}
self.plugins = plugin_list;
}
}
/// Contains all the information for a currently opened tab.
#[derive(Debug, Default, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)]
pub struct TabInfo {
/// The Tab's 0 indexed position
pub position: usize,
/// The... |
rust_dataset_chunk_518089 | rust_dataset.txt | 518,089 | 512 | : bool,
pub attention: crate::attention::TabAttention,
}
/// The `PaneManifest` contains a dictionary of panes, indexed by the tab position (0 indexed).
/// Panes include all panes in the relevant tab, including `tiled` panes, `floating` panes and
/// `suppressed` panes.
#[derive(Debug, Default, Clone, PartialEq, ... |
rust_dataset_chunk_518090 | rust_dataset.txt | 518,090 | 512 | UI
pub exit_status: Option<i32>,
/// A "held" pane is a paused pane that is waiting for user input (eg. a command pane that
/// exited and is waiting to be re-run or closed)
pub is_held: bool,
pub pane_x: usize,
pub pane_content_x: usize,
pub pane_y: usize,
pub pane_content_y: usize,
... |
rust_dataset_chunk_518091 | rust_dataset.txt | 518,091 | 512 | _name: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub pane_command: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pane_cwd: Option<String>,
}
pub type ListPanesResponse = Vec<PaneListEntry>;
pub type ListTabsResponse = Vec<TabInfo>;
#[derive(Debug, Clone, Partial... |
rust_dataset_chunk_518092 | rust_dataset.txt | 518,092 | 512 | pub lines_above_viewport: Vec<String>,
pub lines_below_viewport: Vec<String>,
pub viewport: Vec<String>,
pub selected_text: Option<SelectedText>,
pub cursor: Option<(usize, usize)>,
}
fn extract_text_by_columns(line: &str, start_col: usize, end_col: usize) -> String {
let mut current_col = 0;
... |
rust_dataset_chunk_518093 | rust_dataset.txt | 518,093 | 512 |
if start_line >= self.viewport.len() || end_line >= self.viewport.len() {
return None;
}
if start_line == end_line {
// Single line selection
let line = &self.viewport[start_line];
Some(extract_text_by_columns(line, start_col, end_col))
}... |
rust_dataset_chunk_518094 | rust_dataset.txt | 518,094 | 512 | : PaneId },
Err(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum SaveLayoutResponse {
Ok(()),
Err(String),
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum DeleteLayoutResponse {
Ok(()),
Err(String),
}
#[derive(Debug, Clone, PartialEq, Eq... |
rust_dataset_chunk_518095 | rust_dataset.txt | 518,095 | 512 | #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Deserialize, Serialize)]
pub struct EventContext {
pub slot_id: Option<SlotId>,
pub client_id: Option<ClientId>,
}
#[derive(Debug, Clone, Default, PartialEq, Eq, Deserialize, Serialize)]
pub enum RenderResponse {
#[default]
Nothing,
All,
... |
rust_dataset_chunk_518096 | rust_dataset.txt | 518,096 | 512 | , Deserialize)]
pub enum CopyDestination {
Command,
Primary,
System,
}
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
pub enum PermissionStatus {
Granted,
Denied,
}
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct FileToOpen {
pub path: PathB... |
rust_dataset_chunk_518097 | rust_dataset.txt | 518,097 | 512 | >,
pub message_args: BTreeMap<String, String>,
/// these will only be used in case we need to launch a new plugin to send this message to,
/// since none are running
pub new_plugin_args: Option<NewPluginArgs>,
pub floating_pane_coordinates: Option<FloatingPaneCoordinates>,
}
#[derive(Debug, Default... |
rust_dataset_chunk_518098 | rust_dataset.txt | 518,098 | 512 | : usize, cols: usize, rows: usize) -> Self {
LiveView {
target,
x,
y,
cols,
rows,
resize_allowed: None,
view_only: false,
}
}
}
pub const LIVE_VIEW_DOUBLE_PRESS_MS: u64 = 400;
#[derive(Debug, Clone, PartialEq, Eq)]... |
rust_dataset_chunk_518099 | rust_dataset.txt | 518,099 | 512 | _pane_id) = stringified_pane_id.strip_prefix("plugin_") {
u32::from_str_radix(plugin_pane_id, 10)
.map(|id| PaneId::Plugin(id))
.map_err(|e| e.into())
} else {
u32::from_str_radix(&stringified_pane_id, 10)
.map(|id| PaneId::Terminal(id))
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.