aboutsummaryrefslogtreecommitdiffstats
path: root/default-plugins/fixture-plugin-for-tests/src
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2024-07-29 11:40:01 +0200
committerGitHub <noreply@github.com>2024-07-29 11:40:01 +0200
commit355463383a18fb9e54afd62d718bed4c085a766f (patch)
tree7cf187d4e122133711b45aa249a7e19dc59e1f4f /default-plugins/fixture-plugin-for-tests/src
parentdocs(changelog): more plugin apis (diff)
downloadsl0ppij-355463383a18fb9e54afd62d718bed4c085a766f.tar.gz
sl0ppij-355463383a18fb9e54afd62d718bed4c085a766f.tar.xz
sl0ppij-355463383a18fb9e54afd62d718bed4c085a766f.zip
feat(plugins): allow opening command panes in the background (hidden) (#3530)
* start background pane * open command and edit panes in the background * some cleanups * style(fmt): rustfmt * more cleanups
Diffstat (limited to 'default-plugins/fixture-plugin-for-tests/src')
-rw-r--r--default-plugins/fixture-plugin-for-tests/src/main.rs42
1 files changed, 33 insertions, 9 deletions
diff --git a/default-plugins/fixture-plugin-for-tests/src/main.rs b/default-plugins/fixture-plugin-for-tests/src/main.rs
index 89af6573..70bd2966 100644
--- a/default-plugins/fixture-plugin-for-tests/src/main.rs
+++ b/default-plugins/fixture-plugin-for-tests/src/main.rs
@@ -166,10 +166,13 @@ impl ZellijPlugin for State {
start_or_reload_plugin(plugin_url)
},
BareKey::Char('g') if key.has_modifiers(&[KeyModifier::Ctrl]) => {
- open_file(FileToOpen {
- path: std::path::PathBuf::from("/path/to/my/file.rs"),
- ..Default::default()
- });
+ open_file(
+ FileToOpen {
+ path: std::path::PathBuf::from("/path/to/my/file.rs"),
+ ..Default::default()
+ },
+ BTreeMap::new(),
+ );
},
BareKey::Char('h') if key.has_modifiers(&[KeyModifier::Ctrl]) => {
open_file_floating(
@@ -178,14 +181,18 @@ impl ZellijPlugin for State {
..Default::default()
},
None,
+ BTreeMap::new(),
);
},
BareKey::Char('i') if key.has_modifiers(&[KeyModifier::Ctrl]) => {
- open_file(FileToOpen {
- path: std::path::PathBuf::from("/path/to/my/file.rs"),
- line_number: Some(42),
- ..Default::default()
- });
+ open_file(
+ FileToOpen {
+ path: std::path::PathBuf::from("/path/to/my/file.rs"),
+ line_number: Some(42),
+ ..Default::default()
+ },
+ BTreeMap::new(),
+ );
},
BareKey::Char('j') if key.has_modifiers(&[KeyModifier::Ctrl]) => {
open_file_floating(
@@ -195,6 +202,7 @@ impl ZellijPlugin for State {
..Default::default()
},
None,
+ BTreeMap::new(),
);
},
BareKey::Char('k') if key.has_modifiers(&[KeyModifier::Ctrl]) => {
@@ -335,6 +343,22 @@ impl ZellijPlugin for State {
.to_owned(),
);
},
+ BareKey::Char('a') if key.has_modifiers(&[KeyModifier::Alt]) => {
+ hide_pane_with_id(PaneId::Terminal(1));
+ },
+ BareKey::Char('b') if key.has_modifiers(&[KeyModifier::Alt]) => {
+ show_pane_with_id(PaneId::Terminal(1), true);
+ },
+ BareKey::Char('c') if key.has_modifiers(&[KeyModifier::Alt]) => {
+ open_command_pane_background(
+ CommandToRun {
+ path: std::path::PathBuf::from("/path/to/my/file.rs"),
+ args: vec!["arg1".to_owned(), "arg2".to_owned()],
+ ..Default::default()
+ },
+ BTreeMap::new(),
+ );
+ },
_ => {},
},
Event::CustomMessage(message, payload) => {