diff options
| author | Aram Drevekenin <aram@poor.dev> | 2023-08-24 18:11:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-24 18:11:53 +0200 |
| commit | 09d09759b594dc538a0e629d1778fe5107f344ac (patch) | |
| tree | d185ecfa16eafdcdf42b187d1c85cee26cb71328 /zellij-utils/src/input/layout.rs | |
| parent | docs(changelog): session manager (diff) | |
| download | sl0ppij-09d09759b594dc538a0e629d1778fe5107f344ac.tar.gz sl0ppij-09d09759b594dc538a0e629d1778fe5107f344ac.tar.xz sl0ppij-09d09759b594dc538a0e629d1778fe5107f344ac.zip | |
fix(ux): various ui/ux fixes (#2722)
* force plugin render on permission request response
* clear warnings
* Revert "feat(ui): new status bar mode (#2619)"
This reverts commit 27763d26ab83dd9f81c69c75601cbf6075f13790.
* adjust status bar help
* fix colors in session manager and shortcut in status-bar
* adjust keybindings
Diffstat (limited to 'zellij-utils/src/input/layout.rs')
| -rw-r--r-- | zellij-utils/src/input/layout.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/zellij-utils/src/input/layout.rs b/zellij-utils/src/input/layout.rs index 39d208e8..bd0396a1 100644 --- a/zellij-utils/src/input/layout.rs +++ b/zellij-utils/src/input/layout.rs @@ -207,7 +207,7 @@ impl Run { } } -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Hash)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, Hash, Default)] pub struct RunPlugin { #[serde(default)] pub _allow_exec_host_cmd: bool, @@ -215,6 +215,16 @@ pub struct RunPlugin { pub configuration: PluginUserConfiguration, } +impl RunPlugin { + pub fn from_url(url: &str) -> Result<Self, PluginsConfigError> { + let location = RunPluginLocation::parse(url, None)?; + Ok(RunPlugin { + location, + ..Default::default() + }) + } +} + #[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] pub struct PluginUserConfiguration(BTreeMap<String, String>); @@ -249,6 +259,12 @@ pub enum RunPluginLocation { Zellij(PluginTag), } +impl Default for RunPluginLocation { + fn default() -> Self { + RunPluginLocation::File(Default::default()) + } +} + impl RunPluginLocation { pub fn parse(location: &str, cwd: Option<PathBuf>) -> Result<Self, PluginsConfigError> { let url = Url::parse(location)?; |
