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_514300 | rust_dataset.txt | 514,300 | 512 | plugins_to_update: Vec<(
PluginId,
ClientId,
Arc<Mutex<RunningPlugin>>,
Arc<Mutex<Subscriptions>>,
)> = self
.plugin_map
.lock()
.unwrap()
.running_plugins_and_subscriptions()
.iter()
.cloned... |
rust_dataset_chunk_514301 | rust_dataset.txt | 514,301 | 512 | -windows
let stringified_error =
format!("{:?}", e).replace("\n", "\n\r");
handle_plugin_crash(
plugin_id,
stringified_error,
... |
rust_dataset_chunk_514302 | rust_dataset.txt | 514,302 | 512 | (&run_plugin);
}
}
Ok(())
}
pub fn remove_client(&mut self, client_id: ClientId) {
self.connected_clients
.lock()
.unwrap()
.retain(|c| c != &client_id);
self.keybinds.remove(&client_id);
self.base_modes.remove(&client_id);
... |
rust_dataset_chunk_514303 | rust_dataset.txt | 514,303 | 512 | .clone();
if let Err(e) = std::fs::remove_dir_all(&cache_dir) {
log::error!("Failed to remove data dir for plugin instance: {:?}", e);
}
drop(running_plugin);
drop(subscriptions);
}
});
... |
rust_dataset_chunk_514304 | rust_dataset.txt | 514,304 | 512 | }
}
result
}
pub fn handle_pane_render_report(
&mut self,
pane_render_report: PaneRenderReport,
shutdown_sender: Sender<()>,
) -> Result<()> {
let changed_panes_per_client = self.get_changed_panes_per_client(
&pane_render_report.all_pane_contents... |
rust_dataset_chunk_514305 | rust_dataset.txt | 514,305 | 512 | rp.lock().unwrap().store.data().keybinds.as_ref().clone())
};
if let Some(keybinds) = keybinds {
self.send_keybinds_payload_to_plugin(plugin_id, client_id, keybinds);
}
}
pub fn send_host_terminal_theme_mode_to_plugin(
&self,
plugin_id: PluginId,
cli... |
rust_dataset_chunk_514306 | rust_dataset.txt | 514,306 | 512 | ers.send_to_plugin(PluginInstruction::Update(vec![(
Some(plugin_id),
Some(client_id),
Event::InitialKeybinds(keybinds),
)]));
}
pub fn cleanup(&mut self) {
self.loading_plugins.clear();
self.plugins_to_unload_once_loaded.clear();
let plugin_i... |
rust_dataset_chunk_514307 | rust_dataset.txt | 514,307 | 512 | let default_shell = default_shell.clone();
let layout_dir = layout_dir.clone();
self.plugin_executor.execute_for_plugin(
instance_id,
move |_senders, plugin_map, _connected_clients, _plugin_cache, _engine| {
host_settings_job(plugin_map, insta... |
rust_dataset_chunk_514308 | rust_dataset.txt | 514,308 | 512 | client_id,
keybinds_payload.clone(),
);
}
}
Ok(())
}
fn apply_cached_events_and_resizes_for_plugin(
&mut self,
plugin_id: PluginId,
shutdown_sender: Sender<()>,
) -> Result<()> {
let err_conte... |
rust_dataset_chunk_514309 | rust_dataset.txt | 514,309 | 512 | log::error!("Failed to apply event: {:?}", e);
},
}
},
EventOrPipeMessage::PipeMessage(
pipe_message,
... |
rust_dataset_chunk_514310 | rust_dataset.txt | 514,310 | 512 | bool {
self.loading_plugins
.iter()
.find(|(_plugin_id, run_plugin)| &run_plugin.location == plugin_location)
.is_some()
}
fn plugin_id_of_loading_plugin(
&self,
plugin_location: &RunPluginLocation,
plugin_configuration: &PluginUserConfigurati... |
rust_dataset_chunk_514311 | rust_dataset.txt | 514,311 | 512 | | metadata.cwd.clone())
}
fn plugin_config_of_plugin_id(&self, plugin_id: PluginId) -> Option<PluginConfig> {
self.plugin_map
.lock()
.unwrap()
.metadata(plugin_id)
.map(|metadata| metadata.plugin_config.clone())
}
fn tab_index_of_plugin_id(&self, ... |
rust_dataset_chunk_514312 | rust_dataset.txt | 514,312 | 512 | payload) in messages.drain(..) {
self.cached_worker_messages
.entry(plugin_id)
.or_default()
.push((client_id, worker_name.clone(), message, payload));
}
},
}
Ok(())
}
pub fn ... |
rust_dataset_chunk_514313 | rust_dataset.txt | 514,313 | 512 | insert(plugin_id);
self.cached_events_for_pending_plugins
.entry(plugin_id)
.or_insert_with(Default::default);
}
// gets all running plugins details matching this run_plugin, if none are running, loads one and
// returns its details
pub fn get_or_load_plugins(
&m... |
rust_dataset_chunk_514314 | rust_dataset.txt | 514,314 | 512 | )]
} else {
vec![(plugin_id, Some(client_id))]
}
},
Err(e) => {
log::error!("Failed to load plugin: {e}");
if let Some(cli_clien... |
rust_dataset_chunk_514315 | rust_dataset.txt | 514,315 | 512 | ,
))
.context("failed to unblock input pipe");
}
}
pub fn route_pipe_popup_message(
&mut self,
pipe_id: &str,
pipe_message: PipeMessage,
) -> PipePopupRoute {
match self.pipe_popups.get_mut(pipe_id) {
Some(PipePopup::Opening... |
rust_dataset_chunk_514316 | rust_dataset.txt | 514,316 | 512 | _id),
_ => None,
};
if let Some(cli_client_id) = cli_client_id {
let _ = self.senders.send_to_server(ServerInstruction::LogError(
vec![error],
cli_client_id,
None,
));
}
let release = self
.pe... |
rust_dataset_chunk_514317 | rust_dataset.txt | 514,317 | 512 | Deliver(caller, result) => {
let _ = self.senders.send_to_plugin(PluginInstruction::Update(vec![
caller.result_event(result)
]));
},
PromptAction::Send(plugin_id, client_id, pipe_message) => {
pipe_messag... |
rust_dataset_chunk_514318 | rust_dataset.txt | 514,318 | 512 | unwrap().contains(client_id)
}
pub fn get_first_client_id(&self) -> Option<ClientId> {
self.connected_clients
.lock()
.unwrap()
.iter()
.next()
.copied()
}
pub fn update_available_layouts(
&mut self,
layouts: Vec<LayoutI... |
rust_dataset_chunk_514319 | rust_dataset.txt | 514,319 | 512 | )]));
}
pub fn state_update_for_plugin(&self, plugin_id: PluginId) {
let _ = self.senders.send_to_plugin(PluginInstruction::Update(vec![
(
Some(plugin_id),
None,
Event::AvailableLayoutInfo(
self.available_layouts.clo... |
rust_dataset_chunk_514320 | rust_dataset.txt | 514,320 | 512 | .unwrap_or(false);
self.shared_module_kinds.insert(cache_key, is_shared);
is_shared
}
fn shared_key_of(run_plugin: &RunPlugin) -> SharedKey {
(
run_plugin.location.clone(),
run_plugin
.configuration
.inner()
.get(SH... |
rust_dataset_chunk_514321 | rust_dataset.txt | 514,321 | 512 | ,
plugin_map,
instance_id,
slot_id,
slot,
slot_added_sender,
);
},
);
if instance_is_running && !instanc... |
rust_dataset_chunk_514322 | rust_dataset.txt | 514,322 | 512 | (&slot_id) else {
return;
};
self.plugin_map.lock().unwrap().remove_metadata(slot_id);
let connected_clients: Vec<ClientId> = self.connected_clients.lock().unwrap().clone();
let tear_down = match self.shared_instances.get_mut(&instance_id) {
Some(info) => {
... |
rust_dataset_chunk_514323 | rust_dataset.txt | 514,323 | 512 | ().any(|slot_id| {
plugin_map
.metadata(*slot_id)
.map(|metadata| {
metadata.plugin_config.initial_userspace_configuration
== run_plugin.configuration
})
.unwrap_or(false)
});
if match... |
rust_dataset_chunk_514324 | rust_dataset.txt | 514,324 | 512 | (*slot_id)
.map(|metadata| {
metadata.plugin_config.initial_userspace_configuration
== run_plugin.configuration
})
.unwrap_or(false)
})
.collect()
}... |
rust_dataset_chunk_514325 | rust_dataset.txt | 514,325 | 512 | |senders, plugin_map, _connected_clients, _plugin_cache, _engine| {
client_job(senders, plugin_map, instance_id, client_id, false);
},
);
if let Some(info) = self.shared_instances.get(&instance_id) {
for slot_id in &info.background_slots {
... |
rust_dataset_chunk_514326 | rust_dataset.txt | 514,326 | 512 | Update(mode_info), keybinds)
},
event => (event.clone(), None),
}
}
fn push_shared_event(
&self,
batches: &mut BTreeMap<PluginId, Vec<SharedEventBatchEntry>>,
instance_id: PluginId,
slot_id: Option<PluginId>,
client_id: Option<ClientId>,
... |
rust_dataset_chunk_514327 | rust_dataset.txt | 514,327 | 512 | _s = shutdown_sender.clone();
self.plugin_executor.execute_for_plugin(
instance_id,
move |senders, plugin_map, _connected_clients, _plugin_cache, _engine| {
let _s = _s;
apply_events_job(senders, plugin_map, instance_id, events);
... |
rust_dataset_chunk_514328 | rust_dataset.txt | 514,328 | 512 | , messages) in batches {
let _s = shutdown_sender.clone();
let notification_end = notification_end.take();
self.plugin_executor.execute_for_plugin(
instance_id,
move |senders, plugin_map, _connected_clients, _plugin_cache, _engine| {
... |
rust_dataset_chunk_514329 | rust_dataset.txt | 514,329 | 512 | _location {
// Compare configurations - only fire event if changed
if current_config != new_config {
drop(running_plugin); // Release lock before sending
let event = Event::PluginConfigurationChanged(new_config.inner().clone());
... |
rust_dataset_chunk_514330 | rust_dataset.txt | 514,330 | 512 | ::SessionUpdate(..)
| Event::CopyToClipboard(..)
| Event::SystemClipboardFailure
| Event::CommandPaneOpened(..)
| Event::CommandPaneExited(..)
| Event::PaneClosed(..)
| Event::EditPaneOpened(..)
| Event::EditPaneExited(..)
| Event::FailedToWriteConfigToDis... |
rust_dataset_chunk_514331 | rust_dataset.txt | 514,331 | 512 | if plugin_env.plugin.is_builtin() {
return true;
}
plugin_env
.permissions
.lock()
.unwrap()
.as_ref()
.map(|permissions| permissions.contains(&PermissionType::ReadPaneContents))
.unwrap_or(false)
}
fn redact_pane_info(pane_info: &mut zellij_utils::data:... |
rust_dataset_chunk_514332 | rust_dataset.txt | 514,332 | 512 | : PluginId,
client_id: ClientId,
running_plugin: &mut RunningPlugin,
event: &Event,
plugin_render_assets: &mut Vec<PluginRenderAsset>,
senders: ThreadSenders,
plugin_subscriptions: &HashSet<EventType>,
) -> Result<()> {
let instance = running_plugin.instance.clone();
let err_context = |... |
rust_dataset_chunk_514333 | rust_dataset.txt | 514,333 | 512 | let rows = running_plugin.rows;
let columns = running_plugin.columns;
if rows > 0 && columns > 0 && should_render {
let rendered_bytes = instance
.get_typed_func::<(i32, i32), ()>(&mut running_plugin.store, "... |
rust_dataset_chunk_514334 | rust_dataset.txt | 514,334 | 512 | ("Panic!".to_owned());
loading_indication.indicate_loading_error(message);
let _ = senders.send_to_screen(ScreenInstruction::UpdatePluginLoadingStage(
plugin_id,
loading_indication,
));
let _ = senders.send_to_plugin(PluginInstruction::UnregisterSettingsEntry(plugin_id));
}
pub fn apply... |
rust_dataset_chunk_514335 | rust_dataset.txt | 514,335 | 512 | plugin_env.stdout_pipe.clone(),
)?;
drop(std::mem::replace(&mut plugin_env.wasi_ctx, wasi_ctx));
plugin_env.plugin_cwd = new_host_dir.clone();
Ok(())
}
pub(crate) fn is_hover(event: &Event) -> bool {
matches!(
event,
Event::Mouse(zellij_utils::data::Mouse::Hover(..))
| ... |
rust_dataset_chunk_514336 | rust_dataset.txt | 514,336 | 512 | map(|p| {
let stripped_prefix_path =
p.strip_prefix(¤t_dir).unwrap_or_else(|_| p);
path_prefix_in_plugins.join(stripped_prefix_path)
})
.collect()
... |
rust_dataset_chunk_514337 | rust_dataset.txt | 514,337 | 512 | {
updates.push((
None,
None,
Event::FileSystemDelete(
delete_paths.into_iter().map(|p| (p, None)).collect(),
),
));
}
if !u... |
rust_dataset_chunk_514338 | rust_dataset.txt | 514,338 | 512 | CommandPaneInPlaceOfPaneIdResponse,
OpenCommandPaneInPlaceOfPluginResponse, OpenCommandPaneInPlaceResponse,
OpenCommandPaneNearPluginResponse, OpenCommandPaneResponse,
OpenEditPaneInPlaceOfPaneIdResponse, OpenFileFloatingNearPluginResponse,
OpenFileFloatingResponse, OpenFileInPlaceOfPluginResponse, Open... |
rust_dataset_chunk_514339 | rust_dataset.txt | 514,339 | 512 | Error,
ProtobufPaneScrollbackResponse, ProtobufSyntaxError,
},
plugin_command::{
dump_layout_response, dump_session_layout_response, hide_floating_panes_response,
parse_layout_response, save_session_response, show_floating_panes_response,
ProtobufBreakPane... |
rust_dataset_chunk_514340 | rust_dataset.txt | 514,340 | 512 | ReadConfigResponse,
ProtobufRenameLayoutResponse, ProtobufSaveLayoutResponse, ProtobufSaveSessionResponse,
ProtobufShowFloatingPanesResponse, ProtobufSlotCommandResponse,
ProtobufWriteThemeFileResponse,
},
plugin_ids::{ProtobufPluginIds, ProtobufZellijVersion},
},... |
rust_dataset_chunk_514341 | rust_dataset.txt | 514,341 | 512 | )
} else if let Ok(stripped) = path.strip_prefix("/cache") {
env.plugin_own_cache_dir.join(stripped)
} else if let Ok(stripped) = path.strip_prefix("/tmp") {
ZELLIJ_TMP_DIR.join(stripped)
} else if path.is_relative() {
env.plugin_cwd.join(path)
} else {
// Absolute path n... |
rust_dataset_chunk_514342 | rust_dataset.txt | 514,342 | 512 | | PluginCommand::OpenFileInPlaceOfPlugin(..)
| PluginCommand::OpenTerminalNearPlugin(..)
| PluginCommand::OpenTerminalFloatingNearPlugin(..)
| PluginCommand::OpenTerminalInPlaceOfPlugin(..)
| PluginCommand::OpenCommandPaneNearPlugin(..)
| PluginCom... |
rust_dataset_chunk_514343 | rust_dataset.txt | 514,343 | 512 | _slot_command_response(env, result);
}
fn show_slot(env: &PluginEnv, slot_id: PluginId, should_float_if_hidden: bool) {
let result = slot_command_target(env, slot_id).map(|_| {
let action = Action::FocusPluginPaneWithId {
pane_id: slot_id,
should_float_if_hidden,
should_... |
rust_dataset_chunk_514344 | rust_dataset.txt | 514,344 | 512 | .plugin_cwd.clone()),
) {
Ok(run_plugin_or_alias) => run_plugin_or_alias,
Err(e) => {
log::error!("Failed to open popup: {}", e);
return;
},
};
env.senders
.send_to_screen(ScreenInstruction::OpenPluginPopup {
requesting_plugin_id: self_pane... |
rust_dataset_chunk_514345 | rust_dataset.txt | 514,345 | 512 |
.send_to_screen(ScreenInstruction::SetPopupFocused {
plugin_id: env.plugin_id,
focused,
})
.with_context(|| format!("failed to change popup focus"))
.non_fatal();
}
fn popup_to_floating_pane(env: &mut PluginEnv, coordinates: Option<FloatingPaneCoordinates>) {
... |
rust_dataset_chunk_514346 | rust_dataset.txt | 514,346 | 512 | PluginEnv,
session_name: Option<String>,
command: crate::screen::SessionPaneCommand,
) {
let _ = env
.senders
.send_to_screen(ScreenInstruction::SessionPaneCommand {
session_name,
command,
client_id: acting_client(env),
completion: None,
... |
rust_dataset_chunk_514347 | rust_dataset.txt | 514,347 | 512 | PluginLocation) -> bool {
matches!(location, RunPluginLocation::Zellij(_))
}
fn desktop_integration(env: &PluginEnv, request: String) {
let send_plugin_instructions = env.senders.to_plugin.clone();
let plugin_id = env.plugin_id;
let client_id = acting_client(env);
let allowed = may_change_desktop_i... |
rust_dataset_chunk_514348 | rust_dataset.txt | 514,348 | 512 | Linker<PluginEnv>) {
linker
.func_wrap("zellij", "host_run_plugin_command", host_run_plugin_command)
.unwrap();
}
fn host_run_plugin_command(mut caller: Caller<'_, PluginEnv>) {
let mut env = caller.data_mut();
let plugin_command = env.name();
let err_context = || format!("failed to ru... |
rust_dataset_chunk_514349 | rust_dataset.txt | 514,349 | 512 | SessionSuggestions { limit } => {
get_session_suggestions(env, limit)
},
PluginCommand::SetPopupFocused(focused) => set_popup_focused(env, focused),
PluginCommand::PopupToFloatingPane(coordinates) => {
popup_to_f... |
rust_dataset_chunk_514350 | rust_dataset.txt | 514,350 | 512 | (
env,
Some(session_name),
crate::screen::SessionPaneCommand::Focus(pane_id),
),
PluginCommand::SetLiveView(view) => set_live_view(env, view),
PluginCommand::SetLiveViewInput(capture) => s... |
rust_dataset_chunk_514351 | rust_dataset.txt | 514,351 | 512 | Unsubscribe(event_list) => unsubscribe(env, event_list)?,
PluginCommand::SetSelectable(selectable) => set_selectable(env, selectable),
PluginCommand::ShowCursor(cursor_position) => show_cursor(env, cursor_position),
PluginCommand::GetPluginIds => get_plugin_id... |
rust_dataset_chunk_514352 | rust_dataset.txt | 514,352 | 512 | },
PluginCommand::OpenCommandPane(command_to_run, context) => {
open_command_pane(env, command_to_run, context)
},
PluginCommand::OpenCommandPaneNearPlugin(command_to_run, context) => {
open_command_pane_near_pl... |
rust_dataset_chunk_514353 | rust_dataset.txt | 514,353 | 512 | ,
retain_existing_plugin_panes,
apply_only_to_active_tab,
context,
)?,
PluginCommand::SaveLayout {
layout_name,
layout_kdl,
overwrite,
... |
rust_dataset_chunk_514354 | rust_dataset.txt | 514,354 | 512 | PluginCommand::ClearScreen => clear_screen(env),
PluginCommand::ScrollUp => scroll_up(env),
PluginCommand::ScrollDown => scroll_down(env),
PluginCommand::ScrollToTop => scroll_to_top(env),
PluginCommand::ScrollToBottom =... |
rust_dataset_chunk_514355 | rust_dataset.txt | 514,355 | 512 | tab_index),
PluginCommand::StartOrReloadPlugin(plugin_url) => {
start_or_reload_plugin(env, &plugin_url)?
},
PluginCommand::CloseTerminalPane(terminal_pane_id) => {
close_terminal_pane(env, terminal_pane_id)
... |
rust_dataset_chunk_514356 | rust_dataset.txt | 514,356 | 512 | (env, cwd.path.try_into()?)
},
PluginCommand::OpenTerminalInPlaceOfPlugin(cwd, close_plugin_after_replace) => {
open_terminal_in_place_of_plugin(
env,
cwd.path.try_into()?,
... |
rust_dataset_chunk_514357 | rust_dataset.txt | 514,357 | 512 | , tab_index)
},
PluginCommand::CloseSelf => close_self(env),
PluginCommand::Reconfigure(new_config, write_config_to_disk) => {
reconfigure(env, new_config, write_config_to_disk)?
},
PluginCommand:... |
rust_dataset_chunk_514358 | rust_dataset.txt | 514,358 | 512 | Id(pane_id) => {
move_pane_with_pane_id(env, pane_id.into())
},
PluginCommand::MovePaneWithPaneIdInDirection(pane_id, direction) => {
move_pane_with_pane_id_in_direction(env, pane_id.into(), direction)
},
... |
rust_dataset_chunk_514359 | rust_dataset.txt | 514,359 | 512 | (),
tab_index,
should_change_focus_to_new_tab,
),
PluginCommand::SwitchTabToId(tab_id) => switch_tab_to_id(env, tab_id),
PluginCommand::GoToTabWithId(tab_id) => go_to_tab_with_id(env, tab_id),
... |
rust_dataset_chunk_514360 | rust_dataset.txt | 514,360 | 512 | set_pane_border_style(env, pane_id.into(), border_style)
},
PluginCommand::SetPaneBorderless(pane_id, borderless) => {
set_pane_borderless(env, pane_id.into(), borderless)
},
PluginCommand::SetPaneColor(pane_id, fg,... |
rust_dataset_chunk_514361 | rust_dataset.txt | 514,361 | 512 | StopWebServer => stop_web_server(env),
PluginCommand::QueryWebServerStatus => query_web_server_status(env),
PluginCommand::ShareCurrentSession => share_current_session(env),
PluginCommand::StopSharingCurrentSession => stop_sharing_current_session(env),
... |
rust_dataset_chunk_514362 | rust_dataset.txt | 514,362 | 512 | context,
);
},
PluginCommand::OpenEditorPaneInNewTab(file_to_open, context) => {
open_editor_pane_in_new_tab(env, file_to_open, context);
},
PluginCommand::OpenCommandPaneInPlaceOfPaneId(
... |
rust_dataset_chunk_514363 | rust_dataset.txt | 514,363 | 512 | EventType::FolderSessionsUpdate)
{
let _ = env
.senders
.send_to_background_jobs(BackgroundJob::SessionSuggestions(
SessionSuggestionsJob::Subscribe {
plugin_id: env.plugin_id,
client_id: env.client_id,
},
... |
rust_dataset_chunk_514364 | rust_dataset.txt | 514,364 | 512 | -> Result<()> {
let still_subscribed_to_sessions = {
let mut subscriptions = env.subscriptions.lock().to_anyhow()?;
subscriptions.retain(|k| !event_list.contains(k));
subscriptions.contains(&EventType::SessionCountsUpdate)
|| subscriptions.contains(&EventType::FolderSessionsUpda... |
rust_dataset_chunk_514365 | rust_dataset.txt | 514,365 | 512 | .plugin_id,
});
env.senders
.send_to_screen(ScreenInstruction::RequestPluginPermissions(
permission_pane_id(env),
PluginPermission::new(env.plugin.location.to_string(), permissions),
))
}
fn get_plugin_ids(env: &PluginEnv) {
let ids = PluginIds {
plugin_... |
rust_dataset_chunk_514366 | rust_dataset.txt | 514,366 | 512 | send layout dump to plugin {}", env.name()))
.non_fatal();
}
fn get_layout_dir(env: &PluginEnv) {
// Get layout dir from env or fall back to default
let layout_dir = env.layout_dir.clone().or_else(default_layout_dir);
// Convert PathBuf to String
let layout_dir_string = layout_dir
.an... |
rust_dataset_chunk_514367 | rust_dataset.txt | 514,367 | 512 | )]);
let action = Action::NewTab {
tiled_layout: None,
floating_layouts: vec![],
swap_tiled_layouts: None,
swap_floating_layouts: None,
tab_name: None,
should_change_focus_to_new_tab: true,
cwd: None,
initial_panes,
first_pane_unblock_condition... |
rust_dataset_chunk_514368 | rust_dataset.txt | 514,368 | 512 | _name: None,
should_change_focus_to_new_tab: true,
cwd: None,
initial_panes,
first_pane_unblock_condition: None,
};
let error_msg = || format!("Failed to open plugin pane in new tab");
let result = apply_action!(action, error_msg, env);
let tab_id = result.as_ref().and_t... |
rust_dataset_chunk_514369 | rust_dataset.txt | 514,369 | 512 | : OpenPluginPaneFloatingResponse =
result.and_then(|r| r.affected_pane_id).map(|p| p.into());
let response = ProtobufOpenPluginPaneFloatingResponse::from(pane_id);
wasi_write_object(env, &response.encode_to_vec())
.with_context(|| format!("failed to write open_plugin_pane_floating response"))
... |
rust_dataset_chunk_514370 | rust_dataset.txt | 514,370 | 512 | !(
"failed to get focused pane info for client {:?} from plugin {}",
acting_client(env),
env.name()
)
};
// Create oneshot channel for response
let (response_sender, response_receiver) = crossbeam::channel::bounded(1);
// Send request to screen thread
en... |
rust_dataset_chunk_514371 | rust_dataset.txt | 514,371 | 512 | ane_layout, floating_pane_layout) = layout.new_tab();
vec![TabMetadata::from(&(
None,
tiled_pane_layout,
floating_pane_layout,
))]
} else {
layout
.tabs()
.into... |
rust_dataset_chunk_514372 | rust_dataset.txt | 514,372 | 512 | obufLayoutParsingErrorType::SyntaxError(
ProtobufSyntaxError {},
)),
}
});
ProtobufParseLayoutResponse {
result: Some(parse_layout_response::Result::Error(protobuf_error)),
}
},
};
wasi_writ... |
rust_dataset_chunk_514373 | rust_dataset.txt | 514,373 | 512 | context.clone(),
));
let action_clone = action.clone();
let client_id = acting_client(env);
let plugin_id = env.plugin_id;
let senders = env.senders.clone();
let default_shell = env.default_shell.clone();
let default_mode = env.default_mode.clone();
let plugin_name = env.name().to_strin... |
rust_dataset_chunk_514374 | rust_dataset.txt | 514,374 | 512 | Payload::new(path, file_to_open.line_number, cwd).with_originating_plugin(
OriginatingPlugin::new(env.plugin_id, acting_client(env), context),
),
direction: None,
floating,
in_place,
close_replaced_pane: false,
start_suppressed,
coordinates: FloatingPa... |
rust_dataset_chunk_514375 | rust_dataset.txt | 514,375 | 512 | p.into());
// Write response to plugin
let response = ProtobufOpenFileInPlaceResponse::from(pane_id);
wasi_write_object(env, &response.encode_to_vec())
.with_context(|| format!("failed to write open_file_in_place response"))
.non_fatal();
}
fn open_file_near_plugin(
env: &PluginEnv,
... |
rust_dataset_chunk_514376 | rust_dataset.txt | 514,376 | 512 | {
let floating_pane_coordinates = FloatingPaneCoordinates::merge_border_style(
floating_pane_coordinates,
file_to_open.border_style,
);
let cwd = file_to_open
.cwd
.map(|cwd| translate_plugin_path(env, cwd))
.or_else(|| Some(env.plugin_cwd.clone()));
let path = t... |
rust_dataset_chunk_514377 | rust_dataset.txt | 514,377 | 512 | _originating_plugin(
OriginatingPlugin::new(env.plugin_id, acting_client(env), context),
);
let title = format!("Editing: {}", open_file_payload.path.display());
let open_file = TerminalAction::OpenFile(open_file_payload);
// Create completion channel
let (completion_tx, completion_... |
rust_dataset_chunk_514378 | rust_dataset.txt | 514,378 | 512 | let pane_id: OpenTerminalResponse = result.and_then(|r| r.affected_pane_id).map(|p| p.into());
// Write response to plugin
let response = ProtobufOpenTerminalResponse::from(pane_id);
wasi_write_object(env, &response.encode_to_vec())
.with_context(|| format!("failed to write open_terminal response"... |
rust_dataset_chunk_514379 | rust_dataset.txt | 514,379 | 512 | _shell.clone(),
use_terminal_title: true,
..Default::default()
})
});
default_shell.change_cwd(cwd);
let run_command_action: Option<RunCommandAction> = match default_shell {
TerminalAction::RunCommand(run_command) => Some(run_command.into()),
_ => None,
};... |
rust_dataset_chunk_514380 | rust_dataset.txt | 514,380 | 512 | // Write response to plugin
let response = ProtobufOpenTerminalFloatingNearPluginResponse::from(pane_id);
wasi_write_object(env, &response.encode_to_vec())
.with_context(|| format!("failed to write open_terminal_floating_near_plugin response"))
.non_fatal();
}
fn open_terminal_in_place(env: &P... |
rust_dataset_chunk_514381 | rust_dataset.txt | 514,381 | 512 | _tx, completion_rx) = oneshot::channel();
let _ = env
.senders
.send_to_pty(PtyInstruction::SpawnInPlaceTerminal(
Some(default_shell),
name,
close_plugin_after_replace,
ClientTabIndexOrPaneId::PaneId(PaneId::Plugin(self_pane_id(env))),
Some... |
rust_dataset_chunk_514382 | rust_dataset.txt | 514,382 | 512 | (env))),
Some(NotificationEnd::new(completion_tx)),
None,
));
// Wait for completion
let result =
wait_for_action_completion(completion_rx, "open_command_pane_in_place_of_plugin", false);
let pane_id: OpenCommandPaneInPlaceOfPluginResponse = result.affected_pane_id.m... |
rust_dataset_chunk_514383 | rust_dataset.txt | 514,383 | 512 | ::PaneId,
command_to_run: CommandToRun,
close_replaced_pane: bool,
context: BTreeMap<String, String>,
) {
let command = command_to_run.path;
let _border_style = command_to_run.border_style;
let cwd = command_to_run
.cwd
.map(|cwd| translate_plugin_path(env, cwd));
let args = ... |
rust_dataset_chunk_514384 | rust_dataset.txt | 514,384 | 512 | (|| Some(env.plugin_cwd.clone()));
let path = translate_plugin_path(env, file_to_open.path);
let open_file_payload =
OpenFilePayload::new(path, file_to_open.line_number, cwd).with_originating_plugin(
OriginatingPlugin::new(env.plugin_id, acting_client(env), context),
);
let title... |
rust_dataset_chunk_514385 | rust_dataset.txt | 514,385 | 512 | _terminal_title,
notify: false,
};
let action = Action::NewTiledPane {
direction,
command: Some(run_command_action),
pane_name: name,
near_current_pane: false,
no_focus: false,
borderless: None,
border_style,
tab_id: None,
};
let re... |
rust_dataset_chunk_514386 | rust_dataset.txt | 514,386 | 512 | false, // set_blocking
None,
));
// Wait for completion
let result = wait_for_action_completion(completion_rx, "open_command_pane_near_plugin", false);
let pane_id: OpenCommandPaneNearPluginResponse = result.affected_pane_id.map(|p| p.into());
// Write response to plugin
let re... |
rust_dataset_chunk_514387 | rust_dataset.txt | 514,387 | 512 | _id);
wasi_write_object(env, &response.encode_to_vec())
.with_context(|| format!("failed to write open_command_pane_floating response"))
.non_fatal();
}
fn open_command_pane_floating_near_plugin(
env: &PluginEnv,
command_to_run: CommandToRun,
floating_pane_coordinates: Option<FloatingPa... |
rust_dataset_chunk_514388 | rust_dataset.txt | 514,388 | 512 | .non_fatal();
}
fn open_command_pane_in_place(
env: &PluginEnv,
command_to_run: CommandToRun,
context: BTreeMap<String, String>,
) {
let error_msg = || format!("failed to open command in plugin {}", env.name());
let command = command_to_run.path;
let _border_style = command_to_run.border_style... |
rust_dataset_chunk_514389 | rust_dataset.txt | 514,389 | 512 | let hold_on_close = true;
let hold_on_start = false;
let start_suppressed = true;
let name = None;
let use_terminal_title = false; // TODO: support this
let run_command_action = RunCommandAction {
command,
args,
cwd,
direction,
hold_on_close,
hold_... |
rust_dataset_chunk_514390 | rust_dataset.txt | 514,390 | 512 | _id);
let client_id = acting_client(env);
let plugin_name = env.name();
// Use tokio runtime for async I/O (timer operation)
get_tokio_runtime().spawn(async move {
let start_time = Instant::now();
tokio::time::sleep(Duration::from_secs_f64(secs)).await;
// FIXME: The way that ela... |
rust_dataset_chunk_514391 | rust_dataset.txt | 514,391 | 512 | {
if command_line.is_empty() {
log::error!("Command cannot be empty");
} else {
let command = command_line.remove(0);
let cwd = translate_plugin_path(env, cwd);
let _ = env
.senders
.send_to_background_jobs(BackgroundJob::RunCommand(
env.p... |
rust_dataset_chunk_514392 | rust_dataset.txt | 514,392 | 512 | )))
.with_context(|| format!("failed to hide self"))
}
fn show_self(env: &PluginEnv, should_float_if_hidden: bool) {
let action = Action::FocusPluginPaneWithId {
pane_id: self_pane_id(env),
should_float_if_hidden,
should_be_in_place_if_hidden: false,
};
let error_msg = || fo... |
rust_dataset_chunk_514393 | rust_dataset.txt | 514,393 | 512 | _id: u64, result: PromptResult) {
if !may_reply_to_prompt(&env.plugin.location) {
log::warn!(
"Ignoring a prompt reply from {}: only the prompt plugin can answer prompts",
env.plugin.location.display()
);
return;
}
env.senders
.send_to_plugin(PluginIns... |
rust_dataset_chunk_514394 | rust_dataset.txt | 514,394 | 512 | reset(env: &PluginEnv, new_name: String) {
use zellij_utils::plugin_api::plugin_command::copy_keybind_preset_response::Result as CopyResult;
let client_id = acting_client(env);
let (response_sender, response_receiver) = crossbeam::channel::bounded(1);
let result = match env
.senders
.sen... |
rust_dataset_chunk_514395 | rust_dataset.txt | 514,395 | 512 | theme file result to plugin {}", env.name()))
.non_fatal();
}
fn delete_theme_file(env: &PluginEnv, name: String) {
use zellij_utils::plugin_api::plugin_command::write_theme_file_response::Result as WriteResult;
let client_id = acting_client(env);
let (response_sender, response_receiver) = crossbe... |
rust_dataset_chunk_514396 | rust_dataset.txt | 514,396 | 512 | .with_context(|| format!("failed to send copy result to plugin {}", env.name()))
.non_fatal();
}
fn revert_config(env: &PluginEnv, key: Option<SettingKey>) {
let client_id = acting_client(env);
env.senders
.send_to_server(ServerInstruction::RevertConfig { client_id, key })
.with... |
rust_dataset_chunk_514397 | rust_dataset.txt | 514,397 | 512 | _to_disk: bool,
) {
let client_id = acting_client(env);
env.senders
.send_to_server(ServerInstruction::ResetMousebinds {
client_id,
triggers,
write_config_to_disk,
})
.with_context(|| "Failed to reset mouse bindings")
.non_fatal();
}
fn rebind... |
rust_dataset_chunk_514398 | rust_dataset.txt | 514,398 | 512 | ());
let action = Action::NewTab {
tiled_layout: layout.template.as_ref().map(|t| t.0.clone()),
floating_layouts: layout.template.map(|t| t.1).unwrap_or_default(),
swap_tiled_layouts,
swap_floating_layouts,
tab_name: None,
should_change_foc... |
rust_dataset_chunk_514399 | rust_dataset.txt | 514,399 | 512 | None,
swap_floating_layouts: None,
tab_name: name,
should_change_focus_to_new_tab: true,
cwd,
initial_panes: None,
first_pane_unblock_condition: None,
};
let error_msg = || format!("Failed to open new tab");
let result = apply_action!(action, error_msg, env);... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.