From d3d434aede1286b0172def27da8e8e0c67317e0a Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Mon, 6 Nov 2023 21:56:35 +0100 Subject: [PATCH] docs(api): docs for shim.rs (#2909) --- zellij-server/src/os_input_output.rs | 2 ++ zellij-server/src/panes/terminal_pane.rs | 1 + zellij-tile/src/shim.rs | 8 ++++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/zellij-server/src/os_input_output.rs b/zellij-server/src/os_input_output.rs index 793e5b6653..c74001ea7f 100644 --- a/zellij-server/src/os_input_output.rs +++ b/zellij-server/src/os_input_output.rs @@ -566,6 +566,7 @@ impl ServerOsApi for ServerOsInputOutput { } Ok(()) } + #[allow(unused_assignments)] fn spawn_terminal( &self, terminal_action: TerminalAction, @@ -617,6 +618,7 @@ impl ServerOsApi for ServerOsInputOutput { None => Err(anyhow!("no more terminal IDs left to allocate")), } } + #[allow(unused_assignments)] fn reserve_terminal_id(&self) -> Result { let err_context = || "failed to reserve a terminal ID".to_string(); diff --git a/zellij-server/src/panes/terminal_pane.rs b/zellij-server/src/panes/terminal_pane.rs index b6a03fcfd9..613a9619aa 100644 --- a/zellij-server/src/panes/terminal_pane.rs +++ b/zellij-server/src/panes/terminal_pane.rs @@ -115,6 +115,7 @@ pub struct TerminalPane { // held on startup and can possibly be used to display some errors pane_frame_color_override: Option<(PaletteColor, Option)>, invoked_with: Option, + #[allow(dead_code)] arrow_fonts: bool, } diff --git a/zellij-tile/src/shim.rs b/zellij-tile/src/shim.rs index 8f2b297a3c..6252a8f947 100644 --- a/zellij-tile/src/shim.rs +++ b/zellij-tile/src/shim.rs @@ -91,7 +91,7 @@ pub fn open_file_floating(file_to_open: FileToOpen) { unsafe { host_run_plugin_command() }; } -/// Open a file in the user's default `$EDITOR` in a new floating pane +/// Open a file in the user's default `$EDITOR`, replacing the focused pane pub fn open_file_in_place(file_to_open: FileToOpen) { let plugin_command = PluginCommand::OpenFileInPlace(file_to_open); let protobuf_plugin_command: ProtobufPluginCommand = plugin_command.try_into().unwrap(); @@ -117,7 +117,8 @@ pub fn open_terminal_floating>(path: P) { unsafe { host_run_plugin_command() }; } -/// Open a new floating terminal pane to the specified location on the host filesystem +/// Open a new terminal pane to the specified location on the host filesystem, temporarily +/// replacing the focused pane pub fn open_terminal_in_place>(path: P) { let file_to_open = FileToOpen::new(path.as_ref().to_path_buf()); let plugin_command = PluginCommand::OpenTerminalInPlace(file_to_open); @@ -208,6 +209,9 @@ pub fn run_command_with_env_variables_and_cwd( unsafe { host_run_plugin_command() }; } +/// Make a web request, optionally being notified of its output +/// if subscribed to the `WebRequestResult` Event, the context will be returned verbatim in this +/// event and can be used for eg. marking the request_id pub fn web_request>( url: S, verb: HttpVerb,