aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-tile
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2025-02-20 10:03:34 +0100
committerGitHub <noreply@github.com>2025-02-20 10:03:34 +0100
commitd1a45093455ecc1291a226fb9cbb1eacb35ac01a (patch)
treee88ef9a7b5d20be6e995eb45029ff177666931d9 /zellij-tile
parentdocs(changelog): resize shortcuts (diff)
downloadsl0ppij-d1a45093455ecc1291a226fb9cbb1eacb35ac01a.tar.gz
sl0ppij-d1a45093455ecc1291a226fb9cbb1eacb35ac01a.tar.xz
sl0ppij-d1a45093455ecc1291a226fb9cbb1eacb35ac01a.zip
fix(ux): some filepicker improvements (#4007)
* allow closing plugin pane after replacing it * start of strider improvements * improve strider's ux * fix selected text ui component * style(fmt): rustfmt * style(fmt): rustfmt
Diffstat (limited to 'zellij-tile')
-rw-r--r--zellij-tile/src/shim.rs21
1 files changed, 16 insertions, 5 deletions
diff --git a/zellij-tile/src/shim.rs b/zellij-tile/src/shim.rs
index b717031d..ed7b124e 100644
--- a/zellij-tile/src/shim.rs
+++ b/zellij-tile/src/shim.rs
@@ -126,8 +126,13 @@ pub fn open_file_floating_near_plugin(
}
/// Open a file in the user's default `$EDITOR`, replacing the plugin pane
-pub fn open_file_in_place_of_plugin(file_to_open: FileToOpen, context: BTreeMap<String, String>) {
- let plugin_command = PluginCommand::OpenFileInPlaceOfPlugin(file_to_open, context);
+pub fn open_file_in_place_of_plugin(
+ file_to_open: FileToOpen,
+ close_plugin_after_replace: bool,
+ context: BTreeMap<String, String>,
+) {
+ let plugin_command =
+ PluginCommand::OpenFileInPlaceOfPlugin(file_to_open, close_plugin_after_replace, context);
let protobuf_plugin_command: ProtobufPluginCommand = plugin_command.try_into().unwrap();
object_to_stdout(&protobuf_plugin_command.encode_to_vec());
unsafe { host_run_plugin_command() };
@@ -190,9 +195,10 @@ pub fn open_terminal_in_place<P: AsRef<Path>>(path: P) {
/// Open a new terminal pane to the specified location on the host filesystem, temporarily
/// replacing the plugin pane
-pub fn open_terminal_in_place_of_plugin<P: AsRef<Path>>(path: P) {
+pub fn open_terminal_in_place_of_plugin<P: AsRef<Path>>(path: P, close_plugin_after_replace: bool) {
let file_to_open = FileToOpen::new(path.as_ref().to_path_buf());
- let plugin_command = PluginCommand::OpenTerminalInPlaceOfPlugin(file_to_open);
+ let plugin_command =
+ PluginCommand::OpenTerminalInPlaceOfPlugin(file_to_open, close_plugin_after_replace);
let protobuf_plugin_command: ProtobufPluginCommand = plugin_command.try_into().unwrap();
object_to_stdout(&protobuf_plugin_command.encode_to_vec());
unsafe { host_run_plugin_command() };
@@ -260,9 +266,14 @@ pub fn open_command_pane_in_place(command_to_run: CommandToRun, context: BTreeMa
/// plugin pane rather than whichever pane the user is focused on
pub fn open_command_pane_in_place_of_plugin(
command_to_run: CommandToRun,
+ close_plugin_after_replace: bool,
context: BTreeMap<String, String>,
) {
- let plugin_command = PluginCommand::OpenCommandPaneInPlaceOfPlugin(command_to_run, context);
+ let plugin_command = PluginCommand::OpenCommandPaneInPlaceOfPlugin(
+ command_to_run,
+ close_plugin_after_replace,
+ context,
+ );
let protobuf_plugin_command: ProtobufPluginCommand = plugin_command.try_into().unwrap();
object_to_stdout(&protobuf_plugin_command.encode_to_vec());
unsafe { host_run_plugin_command() };