-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
77 additions
and
63 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,17 @@ | ||
use ratatui::{buffer::Buffer, layout::Rect, widgets::Widget}; | ||
use tracing::info; | ||
use tracing::error; | ||
|
||
pub(super) struct Folder { | ||
kind: FolderKind, | ||
} | ||
|
||
pub(super) enum FolderKind { | ||
pub(super) enum Folder { | ||
Parent = 0, | ||
Current = 1, | ||
Preview = 2, | ||
} | ||
|
||
impl Folder { | ||
pub(super) fn new(kind: FolderKind) -> Self { Self { kind } } | ||
} | ||
|
||
impl Widget for Folder { | ||
fn render(self, area: Rect, buf: &mut Buffer) { | ||
let x = plugin::Folder { kind: self.kind as u8 }.render(area, buf); | ||
if x.is_err() { | ||
info!("{:?}", x); | ||
let folder = plugin::Folder { kind: self as u8 }; | ||
if let Err(e) = folder.render(area, buf) { | ||
error!("{:?}", e); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,5 +70,8 @@ micro_workers = 5 | |
macro_workers = 10 | ||
bizarre_retry = 5 | ||
|
||
[plugins] | ||
preload = [] | ||
|
||
[log] | ||
enabled = false |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
mod plugins; | ||
|
||
pub use plugins::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use std::path::PathBuf; | ||
|
||
use serde::Deserialize; | ||
use shared::expand_path; | ||
use validator::Validate; | ||
|
||
use crate::MERGED_YAZI; | ||
|
||
#[derive(Debug, Deserialize, Validate)] | ||
pub struct Plugins { | ||
pub preload: Vec<PathBuf>, | ||
} | ||
|
||
impl Default for Plugins { | ||
fn default() -> Self { | ||
#[derive(Deserialize)] | ||
struct Outer { | ||
plugins: Plugins, | ||
} | ||
|
||
let mut plugins = toml::from_str::<Outer>(&MERGED_YAZI).unwrap().plugins; | ||
|
||
plugins.preload.iter_mut().for_each(|p| { | ||
*p = expand_path(&p); | ||
}); | ||
|
||
plugins | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters