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_519000
rust_dataset.txt
519,000
512
Ok(Some(Run::EditFile(cwd.join(edit), None, Some(cwd)))) }, (None, Some(edit), None) => Ok(Some(Run::EditFile(edit, None, None))), (Some(_command), Some(_edit), _) => Err(ConfigError::new_layout_kdl_error( "cannot have both a command and an edit instruction for the s...
rust_dataset_chunk_519001
rust_dataset.txt
519,001
512
) -> Result<Option<StackListOrientation>, ConfigError> { match kdl_get_string_property_or_child_value_with_error!(kdl_node, "stack_orientation") { None => Ok(None), Some("vertical") => Ok(Some(StackListOrientation::Vertical)), Some("horizontal") => Ok(Some(StackListOrientati...
rust_dataset_chunk_519002
rust_dataset.txt
519,002
512
acked && external_children_index.is_none() && children.is_empty() { return Err(ConfigError::new_layout_kdl_error( format!("A stacked pane must have children nodes or possibly a \"children\" node if in a swap_layout"), kdl_node.span().offset(), kdl_node.span()....
rust_dataset_chunk_519003
rust_dataset.txt
519,003
512
children_are_stacked, is_expanded_in_stack, stack_orientation, pane_initial_contents, default_fg, default_bg, ..Default::default() }) } fn parse_floating_pane_node( &self, kdl_node: &KdlNode, ) -> Res...
rust_dataset_chunk_519004
rust_dataset.txt
519,004
512
Ok(FloatingPaneLayout { name, attention_muted, ignore_output, height, width, x, y, run, focus, pinned, borderless, border_style, pane_initial_contents, ...
rust_dataset_chunk_519005
rust_dataset.txt
519,005
512
Option<external_children_index> if let Some(pane_child_nodes) = kdl_children_nodes!(kdl_node) { for (i, child) in pane_child_nodes.iter().enumerate() { if kdl_name!(child) == "children" { if let Some(grand_children) = kdl_children_nodes!(child) { ...
rust_dataset_chunk_519006
rust_dataset.txt
519,006
512
dl_node)?; let exclude_from_sync = kdl_get_bool_property_or_child_value_with_error!(kdl_node, "exclude_from_sync"); let external_children_index = if should_mark_external_children_index { self.populate_external_children_index(kdl_node)? ...
rust_dataset_chunk_519007
rust_dataset.txt
519,007
512
} if let Some(is_expanded_in_stack) = is_expanded_in_stack { pane_template.is_expanded_in_stack = is_expanded_in_stack; } pane_template.external_children_index = external_children_index; Ok(pane_template) }, Pan...
rust_dataset_chunk_519008
rust_dataset.txt
519,008
512
_attributes_in_pane_node_with_template( &run, &pane_template.run, &args, &close_on_exit, &start_suspended, kdl_node, )?; pane_template.run = Run::merge(&pane_template.r...
rust_dataset_chunk_519009
rust_dataset.txt
519,009
512
_exit = kdl_get_bool_property_or_child_value_with_error!(kdl_node, "close_on_exit"); let start_suspended = kdl_get_bool_property_or_child_value_with_error!(kdl_node, "start_suspended"); let run = self.parse_command_plugin_or_edit_block_for_template...
rust_dataset_chunk_519010
rust_dataset.txt
519,010
512
_style), ); } Ok(floating_pane) }, } } fn parse_split_direction(&self, kdl_node: &KdlNode) -> Result<SplitDirection, ConfigError> { match kdl_get_string_property_or_child_value_with_error!(kdl_node, "split_direction") { ...
rust_dataset_chunk_519011
rust_dataset.txt
519,011
512
has_pane_properties || has_floating_pane_properties { Ok(false) } else { Ok(true) } } fn differentiate_pane_and_floating_pane_template( &self, kdl_node: &KdlNode, ) -> Result<bool, ConfigError> { // returns true if it's a floating_pane templat...
rust_dataset_chunk_519012
rust_dataset.txt
519,012
512
.push("split_direction"); } if has_children_nodes { pane_properties.push("child nodes"); } let mut floating_pane_properties = vec![]; if height.is_some() { floating_pane_properties.push("height"); } if wi...
rust_dataset_chunk_519013
rust_dataset.txt
519,013
512
}), kdl_node.clone(), ), ); } else if is_floating { self.assert_valid_floating_pane_properties(kdl_node)?; // floating pane properties let height = self.parse_percent_or_fixed(kdl_node, "height", false)?; ...
rust_dataset_chunk_519014
rust_dataset.txt
519,014
512
template_name, ( PaneOrFloatingPane::Pane(TiledPaneLayout { borderless, border_style, focus, split_size, run, children_split...
rust_dataset_chunk_519015
rust_dataset.txt
519,015
512
_to_layout(&cwd_prefix); } } Ok((is_focused, tab_name, pane_layout, child_floating_panes)) } fn parse_child_pane_nodes_for_tab( &self, children: &[KdlNode], should_mark_external_children_index: bool, child_floating_panes: &mut Vec<FloatingPaneLayout>, ...
rust_dataset_chunk_519016
rust_dataset.txt
519,016
512
kdl_name!(child) == "children" { if let Some(grand_children) = kdl_children_nodes!(child) { let grand_children: Vec<&str> = grand_children.iter().map(|g| kdl_name!(g)).collect(); if !grand_children.is_empty() { retu...
rust_dataset_chunk_519017
rust_dataset.txt
519,017
512
{ return true; } } } false } fn assert_no_bare_attributes_in_pane_node_with_template( &self, pane_run: &Option<Run>, pane_template_run: &Option<Run>, args: &Option<Vec<String>>, close_on_exit: &Option<bool>,...
rust_dataset_chunk_519018
rust_dataset.txt
519,018
512
only be set if a command was specified".into(), pane_node.span().offset(), pane_node.span().len(), )); } } Ok(()) } fn assert_one_children_block( &self, layout: &TiledPaneLayout, kdl_node: &KdlNode, ...
rust_dataset_chunk_519019
rust_dataset.txt
519,019
512
} fn assert_valid_pane_or_floating_pane_properties( &self, pane_node: &KdlNode, ) -> Result<(), ConfigError> { for entry in pane_node.entries() { match entry .name() .map(|e| e.value()) .or_else(|| entry.value().as_string())...
rust_dataset_chunk_519020
rust_dataset.txt
519,020
512
_prop { offending_nodes.push("borderless"); } if has_non_cwd_run_prop { offending_nodes.push("command/edit/plugin"); } if has_cwd_prop { offending_nodes.push("cwd"); } Err(ConfigError::new_layout_kdl_...
rust_dataset_chunk_519021
rust_dataset.txt
519,021
512
_layout = TiledPaneLayout { children_split_direction, children: child_panes, ..Default::default() }; self.assert_one_children_block(&tab_layout, &tab_layout_kdl_node)?; self.insert_layout_children_or_error( ...
rust_dataset_chunk_519022
rust_dataset.txt
519,022
512
_tab_template_node(kdl_node)?; self.tab_templates.insert( template_name, (tab_template, tab_template_floating_panes, kdl_node.clone()), ); Ok(()) } fn populate_default_tab_template(&mut self, kdl_node: &KdlNode) -> Result<(), ConfigError> { let (tab_templa...
rust_dataset_chunk_519023
rust_dataset.txt
519,023
512
_template, pane_template_kdl_node)) = self.pane_templates.get(kdl_name!(child)).cloned() { let should_mark_external_children_index = false; tab_children.push(self.parse_pane_node_with_template( child, ...
rust_dataset_chunk_519024
rust_dataset.txt
519,024
512
name".into(), child.span().offset(), child.span().len(), ), )?; let mut template_children = HashSet::new(); self.get_pane_template_dependencies(child, &mut template_children)?; if depende...
rust_dataset_chunk_519025
rust_dataset.txt
519,025
512
cwd")?; } Ok(()) } fn populate_pane_templates( &mut self, layout_children: &[KdlNode], kdl_layout: &KdlDocument, ) -> Result<(), ConfigError> { let mut pane_template_dependency_tree = self.get_pane_template_dependency_tree(layout_children)?; ...
rust_dataset_chunk_519026
rust_dataset.txt
519,026
512
if child_name == "swap_tiled_layout" { let swap_layout_name = kdl_get_string_property_or_child_value!(child, "name").map(|n| String::from(n)); if let Some(swap_tiled_layout_group) = kdl_children_nodes!(child) { let mut swap_tiled_layout = BTreeMap...
rust_dataset_chunk_519027
rust_dataset.txt
519,027
512
!(child, "name").map(|n| String::from(n)); if let Some(swap_floating_layout_group) = kdl_children_nodes!(child) { let mut swap_floating_layout = BTreeMap::new(); for layout in swap_floating_layout_group { let layout_node_name = kdl_name!(la...
rust_dataset_chunk_519028
rust_dataset.txt
519,028
512
(kdl_parsing_error!( format!( "exact_panes should be a fixed number (eg. 1) and not a quoted string (\"{}\")", exact_panes, ), layout_node )); }; let max_panes = kdl_get_int_property_or_child_value!(layou...
rust_dataset_chunk_519029
rust_dataset.txt
519,029
512
_template: TiledPaneLayout, tab_template_kdl_node: KdlNode, ) -> Result<TiledPaneLayout, ConfigError> { let should_mark_external_children_index = true; let layout = self.parse_tab_node_with_template( layout_node, tab_template, vec![], // no floating_panes ...
rust_dataset_chunk_519030
rust_dataset.txt
519,030
512
}; Ok(Layout { tabs, template, focused_tab_index, swap_tiled_layouts, swap_floating_layouts, ..Default::default() }) } fn layout_with_one_tab( &self, panes: Vec<TiledPaneLayout>, floating_pan...
rust_dataset_chunk_519031
rust_dataset.txt
519,031
512
::default() }) } fn layout_with_one_pane( &self, child_floating_panes: Vec<FloatingPaneLayout>, swap_tiled_layouts: Vec<SwapTiledLayout>, swap_floating_layouts: Vec<SwapFloatingLayout>, tab_name: Option<String>, split_direction: SplitDirection, hid...
rust_dataset_chunk_519032
rust_dataset.txt
519,032
512
TiledPaneLayout, Vec<FloatingPaneLayout>, )>, child_panes: &mut Vec<TiledPaneLayout>, child_floating_panes: &mut Vec<FloatingPaneLayout>, ) -> Result<(), ConfigError> { let child_name = kdl_name!(child); if (child_name == "pane" || child_name == "float...
rust_dataset_chunk_519033
rust_dataset.txt
519,033
512
".into(), child.span().offset(), child.span().len(), )); } let should_mark_external_children_index = false; child_tabs.push(self.parse_tab_node_with_template( child, tab_template, ...
rust_dataset_chunk_519034
rust_dataset.txt
519,034
512
only contain pane nodes, found: {}", kdl_name!(child) ), child.span().offset(), child.span().len(), )); } } }; Ok(()) } pub fn parse_external_swap_...
rust_dataset_chunk_519035
rust_dataset.txt
519,035
512
_kdl_error( "No layout found".into(), kdl_layout.span().offset(), kdl_layout.span().len(), ))?; let has_multiple_layout_nodes = kdl_layout .nodes() .iter() .filter(|n| kdl_name!(n) == "layout") .count() ...
rust_dataset_chunk_519036
rust_dataset.txt
519,036
512
_hide_floating = kdl_get_bool_property_or_child_value!(layout_node, "hide_floating_panes").is_some(); if layout_has_tab_name { return Err(ConfigError::new_layout_kdl_error( "The 'name' property on the layout node is treated as a tab name and cannot be use...
rust_dataset_chunk_519037
rust_dataset.txt
519,037
512
focused_tab_index, swap_tiled_layouts, swap_floating_layouts, ) } else if !child_panes.is_empty() { // Extract tab properties from layout_node let tab_name = kdl_get_string_property_or_child_value!(layout_node, "...
rust_dataset_chunk_519038
rust_dataset.txt
519,038
512
ClickedPaneAction, ClickedTabAction, ContextMenuAction, ContextMenuEntry, HiddenBars, TAB_POSITION_END, }; use crate::envs::EnvironmentVariables; use crate::home::{find_default_config_dir, get_layout_dir}; use crate::input::config::{Config, ConfigError, KdlError}; use crate::input::context_menu::{ context_m...
rust_dataset_chunk_519039
rust_dataset.txt
519,039
512
} #[inline(never)] pub fn action_without_arguments( action_name: &str, has_arguments: bool, action_node: &KdlNode, ) -> Result<Action, ConfigError> { if has_arguments { return Err(ConfigError::new_kdl_error( format!("Action '{}' must have arguments", action_name), action...
rust_dataset_chunk_519040
rust_dataset.txt
519,040
512
FloatingPanes" => Ok(Action::ShowFloatingPanes { tab_id: None }), "HideFloatingPanes" => Ok(Action::HideFloatingPanes { tab_id: None }), "ToggleBars" => Ok(Action::ToggleBars { bars: vec![] }), "HideBars" => Ok(Action::HideBars { bars: vec![] }), "ShowBars" => Ok(Action::ShowBars), ...
rust_dataset_chunk_519041
rust_dataset.txt
519,041
512
MarkAllSeen { session: None, this_session: false, }), "Copy" => Ok(Action::Copy), "Confirm" => Ok(Action::Confirm), "Deny" => Ok(Action::Deny), "ToggleMouseMode" => Ok(Action::ToggleMouseMode), "PreviousSwapLayout" => Ok(Action::PreviousSwapLayout)...
rust_dataset_chunk_519042
rust_dataset.txt
519,042
512
_export] macro_rules! kdl_first_entry_as_bool { ( $node:expr ) => { $node .entries() .iter() .next() .and_then(|i| i.value().as_bool()) }; } #[macro_export] macro_rules! entry_count { ( $node:expr ) => {{ $node.entries().iter().len() }}; }...
rust_dataset_chunk_519043
rust_dataset.txt
519,043
512
.entries() .iter() .filter_map(|e| e.name()) .map(|e| e.value()) }}; } #[macro_export] macro_rules! kdl_children_or_error { ( $kdl_node:expr, $error:expr ) => { $kdl_node.children().ok_or(ConfigError::new_kdl_error( $error.into(), $kdl_node.s...
rust_dataset_chunk_519044
rust_dataset.txt
519,044
512
().name().value() }; } #[macro_export] macro_rules! keys_from_kdl { ( $kdl_node:expr ) => { kdl_string_arguments!($kdl_node) .iter() .map(|k| { KeyWithModifier::from_str(k).map_err(|_| { ConfigError::new_kdl_error( form...
rust_dataset_chunk_519045
rust_dataset.txt
519,045
512
a str> { command_metadata .get(entry_name) .and_then(|cwd| cwd.entries().iter().next()) .and_then(|cwd_value| cwd_value.value().as_string()) } pub fn kdl_child_bool_value_for_entry<'a>( command_metadata: &'a KdlDocument, entry_name: &'a str, ) -> Option<bool> { command_metadata ...
rust_dataset_chunk_519046
rust_dataset.txt
519,046
512
map_err(|e| { ConfigError::new_kdl_error( format!("{}", e), action_node.span().offset(), action_node.span().len(), ) })?; Ok(Action::SetPaneFrameStyle(style)) }, ...
rust_dataset_chunk_519047
rust_dataset.txt
519,047
512
})?; if direction.is_vertical() { Err(ConfigError::new_kdl_error( format!("Invalid horizontal direction: '{}'", string), action_node.span().offset(), action_node.span().len(), ...
rust_dataset_chunk_519048
rust_dataset.txt
519,048
512
let search_direction = SearchDirection::from_str(string.as_str()).map_err(|_| { ConfigError::new_kdl_error( format!("Invalid direction: '{}'", string), action_node.span().offset(), ...
rust_dataset_chunk_519049
rust_dataset.txt
519,049
512
(KdlNode::new("FocusLastPane")), Action::SwitchFocus => Some(KdlNode::new("SwitchFocus")), Action::MoveFocus { direction } => { let mut node = KdlNode::new("MoveFocus"); let direction = match direction { Direction::Left => "left", ...
rust_dataset_chunk_519050
rust_dataset.txt
519,050
512
Action::ScrollToBottom => Some(KdlNode::new("ScrollToBottom")), Action::ScrollToTop => Some(KdlNode::new("ScrollToTop")), Action::ScrollToPreviousPrompt => Some(KdlNode::new("ScrollToPreviousPrompt")), Action::ScrollToNextPrompt => Some(KdlNode::new("ScrollToNextPrompt")), ...
rust_dataset_chunk_519051
rust_dataset.txt
519,051
512
ToggleFloatingPanes")), Action::ShowFloatingPanes { tab_id } => { let mut node = KdlNode::new("ShowFloatingPanes"); if let Some(id) = tab_id { node.push(KdlValue::Base10(*id as i64)); } Some(node) }, ...
rust_dataset_chunk_519052
rust_dataset.txt
519,052
512
name_node.push(name.clone()); children.nodes_mut().push(name_node); } if let Some(cwd) = cwd { let mut cwd_node = KdlNode::new("cwd"); cwd_node.push(cwd.display().to_string()); children.nodes_mut().push(cwd_...
rust_dataset_chunk_519053
rust_dataset.txt
519,053
512
let Some(run_command_action) = run_command_action { node.push(run_command_action.command.display().to_string()); for arg in &run_command_action.args { node.push(arg.clone()); } if let Some(cwd) = &run_command_action...
rust_dataset_chunk_519054
rust_dataset.txt
519,054
512
node.push(run_command_action.command.display().to_string()); for arg in &run_command_action.args { node.push(arg.clone()); } if let Some(cwd) = &run_command_action.cwd { let mut cwd_node = Kdl...
rust_dataset_chunk_519055
rust_dataset.txt
519,055
512
height { PercentOrFixed::Percent(height) => { height_node.push(format!("{}%", height)); }, PercentOrFixed::Fixed(height) => { height_node.push(KdlValue::Base10(height as i...
rust_dataset_chunk_519056
rust_dataset.txt
519,056
512
name_node = KdlNode::new("name"); name_node.push(name.clone()); node_children.nodes_mut().push(name_node); } if !node_children.nodes().is_empty() { node.set_children(node_children); } Some(node) ...
rust_dataset_chunk_519057
rust_dataset.txt
519,057
512
{ node.push(arg.clone()); } let mut background_node = KdlNode::new("background"); background_node.push(KdlValue::Bool(true)); node_children.nodes_mut().push(background_node); if let Some(cwd) = &run_command_action.cwd {...
rust_dataset_chunk_519058
rust_dataset.txt
519,058
512
} if *move_to_focused_tab { let mut move_to_focused_tab_node = KdlNode::new("move_to_focused_tab"); move_to_focused_tab_node.push(KdlValue::Bool(true)); node_children.nodes_mut().push(move_to_focused_tab_node); }...
rust_dataset_chunk_519059
rust_dataset.txt
519,059
512
close_replaced_pane { let mut crp_node = KdlNode::new("close_replaced_pane"); crp_node.push(KdlValue::Bool(true)); node_children.nodes_mut().push(crp_node); } if *skip_plugin_cache { let mut skip_plugin_cache...
rust_dataset_chunk_519060
rust_dataset.txt
519,060
512
Node::new("PreviousSwapLayout")), Action::NextSwapLayout => Some(KdlNode::new("NextSwapLayout")), Action::ApplyTiledSwapLayout { name } => { let mut node = KdlNode::new("ApplyTiledSwapLayout"); node.push(name.clone()); Some(node) }, ...
rust_dataset_chunk_519061
rust_dataset.txt
519,061
512
_mut().push(skip_cache_node); } if let Some(floating) = floating { let mut floating_node = KdlNode::new("floating"); floating_node.push(KdlValue::Bool(*floating)); node_children.nodes_mut().push(floating_node); }...
rust_dataset_chunk_519062
rust_dataset.txt
519,062
512
("GoToPreviousSession")), Action::GoToNextSession => Some(KdlNode::new("GoToNextSession")), Action::GoToNextAttention => Some(KdlNode::new("GoToNextAttention")), Action::ToggleTrayIcon => Some(KdlNode::new("ToggleTrayIcon")), Action::OpenSessionInTerminal => Some(KdlNode:...
rust_dataset_chunk_519063
rust_dataset.txt
519,063
512
.. } => "TogglePanePinnedByPaneId", Action::TogglePaneInGroupByPaneId { .. } => "TogglePaneInGroupByPaneId", Action::MutePaneByPaneId { .. } => "MutePaneByPaneId", Action::IgnorePaneOutputByPaneId { .. } => "IgnorePaneOutputByPaneId", Acti...
rust_dataset_chunk_519064
rust_dataset.txt
519,064
512
) -> KdlValue { if position == 0 { KdlValue::String("start".into()) } else if position > i64::MAX as u64 { KdlValue::String("end".into()) } else { KdlValue::Base10(position as i64) } } fn tab_position_from_kdl_entry(entry: &KdlEntry) -> Result<u64, ConfigError> { match entry...
rust_dataset_chunk_519065
rust_dataset.txt
519,065
512
_of_range = || { ConfigError::new_kdl_error( "color values must be numbers from 0 to 255".into(), color.span().offset(), color.span().len(), ) }; let channel = |value: Option<i64>| -> Result<u8, ConfigError> { let value ...
rust_dataset_chunk_519066
rust_dataset.txt
519,066
512
r = u8::from_str_radix(&s[0..2], 16).map_err(|_| { ConfigError::new_kdl_error( "Failed to parse hex color".into(), color.span().offset(), color.span().len(), ) })?; let g = u8::from_str_radix(&s[2..4], 1...
rust_dataset_chunk_519067
rust_dataset.txt
519,067
512
table it is defining", color_name ), offset, len, )); } Ok(color) } impl TerminalColors { pub fn from_kdl(kdl: &KdlNode) -> Result<Self, ConfigError> { let mut table = TerminalColors::default(); let Some(colors) = kdl.children() e...
rust_dataset_chunk_519068
rust_dataset.txt
519,068
512
.emphasis_3.to_kdl("emphasis_3")); node.set_children(doc); node } } impl MultiplayerColors { pub fn to_kdl(&self) -> KdlNode { let mut node = KdlNode::new("multiplayer_user_colors"); let mut doc = KdlDocument::new(); doc.nodes_mut().push(self.player_1.to_kdl("player_1"))...
rust_dataset_chunk_519069
rust_dataset.txt
519,069
512
dl_action_arguments!(action_name, action_arguments, kdl_action) }, "ToggleHostFullscreen" => { parse_kdl_action_arguments!(action_name, action_arguments, kdl_action) }, "SwitchFocus" => parse_kdl_action_arguments!(action_name, action_arguments, kdl_action)...
rust_dataset_chunk_519070
rust_dataset.txt
519,070
512
, kdl_action) }, "ToggleStackListOrientation" => { parse_kdl_action_arguments!(action_name, action_arguments, kdl_action) }, "ToggleActiveSyncTab" => { parse_kdl_action_arguments!(action_name, action_arguments, kdl_action) }, ...
rust_dataset_chunk_519071
rust_dataset.txt
519,071
512
_arguments, kdl_action) }, "UndoRenameSession" => { parse_kdl_action_arguments!(action_name, action_arguments, kdl_action) }, "ToggleMouseMode" => { parse_kdl_action_arguments!(action_name, action_arguments, kdl_action) }, ...
rust_dataset_chunk_519072
rust_dataset.txt
519,072
512
as usize); let pane_id = crate::kdl_get_int_property_or_child_value!(kdl_action, "pane_id") .map(|i| i as u32); let is_plugin = crate::kdl_get_bool_property_or_child_value!(kdl_action, "is_plugin") .unwrap_or(false); ...
rust_dataset_chunk_519073
rust_dataset.txt
519,073
512
dl_action ), "Resize" => parse_kdl_action_char_or_string_arguments!( action_name, action_arguments, kdl_action ), "ResizeNew" => parse_kdl_action_char_or_string_arguments!( action_name, action...
rust_dataset_chunk_519074
rust_dataset.txt
519,074
512
or_else(|| config_options.default_layout.clone()); let cwd = command_metadata .and_then(|c_m| kdl_child_string_value_for_entry(c_m, "cwd")) .map(|cwd_string| PathBuf::from(cwd_string)) .map(|cwd| current_dir.join(cwd)); let name...
rust_dataset_chunk_519075
rust_dataset.txt
519,075
512
_to_new_tab, cwd, initial_panes: None, first_pane_unblock_condition: None, }) } else { let (layout, floating_panes_layout) = layout.new_tab(); let should_change_focus_to_ne...
rust_dataset_chunk_519076
rust_dataset.txt
519,076
512
(false); let layout_dir = config_options .layout_dir .clone() .or_else(|| get_layout_dir(find_default_config_dir())); let (path_to_raw_layout, raw_layout, swap_layouts) = Layout::stringified_from_path_or_def...
rust_dataset_chunk_519077
rust_dataset.txt
519,077
512
, }; Ok(Action::OverrideLayout { tabs: vec![tab_layout_info], retain_existing_terminal_panes, retain_existing_plugin_panes, apply_only_to_active_tab, }) ...
rust_dataset_chunk_519078
rust_dataset.txt
519,078
512
.and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "floating")) .unwrap_or(false); let in_place = command_metadata .and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "in_place")) .unwrap_or(false); let clo...
rust_dataset_chunk_519079
rust_dataset.txt
519,079
512
() }, None => None, }; if floating { Ok(Action::NewFloatingPane { command: Some(run_command_action), pane_name: name, coordinates: FloatingPaneCoordinates::...
rust_dataset_chunk_519080
rust_dataset.txt
519,080
512
.and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "close_replaced_pane")) .unwrap_or(false); let skip_plugin_cache = command_metadata .and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "skip_plugin_cache")) .unwrap_or(false); ...
rust_dataset_chunk_519081
rust_dataset.txt
519,081
512
.unwrap_or(false); let skip_plugin_cache = command_metadata .and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "skip_plugin_cache")) .unwrap_or(false); let current_dir = std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")); ...
rust_dataset_chunk_519082
rust_dataset.txt
519,082
512
_metadata .and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "skip_cache")) .unwrap_or(false); let should_float = command_metadata .and_then(|c_m| kdl_child_bool_value_for_entry(c_m, "floating")) .unwrap_or(false); ...
rust_dataset_chunk_519083
rust_dataset.txt
519,083
512
command_metadata .and_then(|c_m| kdl_child_string_value_for_entry(c_m, "name")) .map(|n| n.to_owned()); let payload = command_metadata .and_then(|c_m| kdl_child_string_value_for_entry(c_m, "payload")) .map(|p| p.to_owned())...
rust_dataset_chunk_519084
rust_dataset.txt
519,084
512
\"", action_name), entry ) })?; let pane_id = PaneId::from_str(pane_id_string).map_err(|_| { kdl_parsing_error!(format!("Malformed pane id: {}", pane_id_string), entry) })?; Ok(match action_na...
rust_dataset_chunk_519085
rust_dataset.txt
519,085
512
" { Ok(Action::MuteTabByTabId { id }) } else { Ok(Action::StartRenameTabByTabId { id }) } }, "MoveTabByTabId" => { let direction_entry = action_arguments.first().ok_or_else(|| { ConfigErro...
rust_dataset_chunk_519086
rust_dataset.txt
519,086
512
as u64; Ok(Action::MoveTabToPosition { id, position }) }, "TogglePaneInGroup" => Ok(Action::TogglePaneInGroup), "ToggleGroupMarking" => Ok(Action::ToggleGroupMarking), _ => Err(ConfigError::new_kdl_error( format!("Unsupported action: {}", ...
rust_dataset_chunk_519087
rust_dataset.txt
519,087
512
property.span().len(), )); }, }, None => { return Err(ConfigError::new_kdl_error( format!("Property {} must have a value", $property_name), property...
rust_dataset_chunk_519088
rust_dataset.txt
519,088
512
_as_bool { ( $kdl_node:expr, $property_name:expr ) => { $kdl_node .children() .and_then(|c| c.get($property_name)) .and_then(|p| p.entries().iter().next()) .and_then(|p| p.value().as_bool()) }; } #[macro_export] macro_rules! kdl_property_first_arg_as_i64 ...
rust_dataset_chunk_519089
rust_dataset.txt
519,089
512
Some(e) => match e.value().as_bool() { Some(bool_value) => Some(bool_value), None => { return Err(kdl_parsing_error!( format!( "{} should be either true or false, found {}", $n...
rust_dataset_chunk_519090
rust_dataset.txt
519,090
512
dl_node.span().offset(), $kdl_node.span().len(), )) }}; } #[macro_export] macro_rules! kdl_get_string_property_or_child_value_with_error { ( $kdl_node:expr, $name:expr ) => { match $kdl_node.get($name) { Some(e) => match e.value().as_string() { So...
rust_dataset_chunk_519091
rust_dataset.txt
519,091
512
_then(|c| c.get(0)) .and_then(|c| c.value().as_i64()) }) }; } #[macro_export] macro_rules! kdl_get_string_entry { ( $kdl_node:expr, $entry_name:expr ) => { $kdl_node .get($entry_name) .and_then(|e| e.value().as_string()) }; } #[macro_export] ...
rust_dataset_chunk_519092
rust_dataset.txt
519,092
512
map(|(v, _)| v); let theme = kdl_property_first_arg_as_string_or_error!(kdl_options, "theme") .map(|(theme, _entry)| theme.to_string()); let theme_dark = kdl_property_first_arg_as_string_or_error!(kdl_options, "theme_dark") .map(|(theme, _entry)| theme.to_string()); let t...
rust_dataset_chunk_519093
rust_dataset.txt
519,093
512
scroll_buffer_size, _entry)| scroll_buffer_size as usize); let copy_command = kdl_property_first_arg_as_string_or_error!(kdl_options, "copy_command") .map(|(copy_command, _entry)| copy_command.to_string()); let copy_clipboard = match kdl_property_first_arg_as_string_or_error!(kdl...
rust_dataset_chunk_519094
rust_dataset.txt
519,094
512
.map(|(v, _)| v); let serialization_interval = kdl_property_first_arg_as_i64_or_error!(kdl_options, "serialization_interval") .map(|(scroll_buffer_size, _entry)| scroll_buffer_size as u64); let disable_session_metadata = kdl_property_first_arg_as_b...
rust_dataset_chunk_519095
rust_dataset.txt
519,095
512
_error!( kdl_options, "stacked_pane_list_orientation" ) { Some((string, entry)) => { Some(StackListOrientation::from_str(string).map_err(|_| { kdl_parsing_error!( format!( "Invalid value f...
rust_dataset_chunk_519096
rust_dataset.txt
519,096
512
entry)| web_server_port as u16); let web_server_cert = kdl_property_first_arg_as_string_or_error!(kdl_options, "web_server_cert") .map(|(string, _entry)| PathBuf::from(string)); let web_server_key = kdl_property_first_arg_as_string_or_error!(kdl_options, "web_serv...
rust_dataset_chunk_519097
rust_dataset.txt
519,097
512
_command_selection") .map(|(v, _)| v); let word_separators = kdl_property_first_arg_as_string_or_error!(kdl_options, "word_separators") .map(|(separators, _entry)| separators.to_string()); let nested_session_handling = match kdl_property_first_arg_as_string_or...
rust_dataset_chunk_519098
rust_dataset.txt
519,098
512
Ok(hidden_bars) => Some(hidden_bars), Err(e) => { return Err(ConfigError::new_kdl_error( e, property.span().offset(), property.span().len(), )) }, ...
rust_dataset_chunk_519099
rust_dataset.txt
519,099
512
, client_async_worker_tasks, nested_session_handling, dangerously_enable_paste_buffer_read, session_indicator, swap_layout_notification, on_quit, bars_hidden_on_start, hidden_bars_notification, mode_hints_when_ba...