aboutsummaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-04-29 18:09:14 +0200
committerGitHub <noreply@github.com>2021-04-29 18:09:14 +0200
commitb5d38e95c876f231a1c52ab2bcf805f65958d56c (patch)
tree8146e3d70b67d3705302e09e81d4bb62d18a31e1 /src/client
parentfix(ci): name assets consistently (diff)
parentFix Startup with Default in Same Folder (diff)
downloadsl0ppij-b5d38e95c876f231a1c52ab2bcf805f65958d56c.tar.gz
sl0ppij-b5d38e95c876f231a1c52ab2bcf805f65958d56c.tar.xz
sl0ppij-b5d38e95c876f231a1c52ab2bcf805f65958d56c.zip
Merge pull request #407 from a-kenji/default-layout
Fix Startup with Default in Same Folder
Diffstat (limited to 'src/client')
-rw-r--r--src/client/layout.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client/layout.rs b/src/client/layout.rs
index e28058ba..ca1adb4d 100644
--- a/src/client/layout.rs
+++ b/src/client/layout.rs
@@ -205,6 +205,18 @@ impl Layout {
layout
}
+ // It wants to use Path here, but that doesn't compile.
+ #[warn(clippy::ptr_arg)]
+ pub fn from_defaults(layout_path: &PathBuf, data_dir: &Path) -> Self {
+ Self::new(
+ &data_dir
+ .join("layouts/")
+ .join(layout_path)
+ .with_extension("yaml"),
+ &data_dir,
+ )
+ }
+
pub fn total_terminal_panes(&self) -> usize {
let mut total_panes = 0;
total_panes += self.parts.len();