diff options
author | Jamie <hello@itsjamie.dev> | 2022-10-11 09:02:46 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-11 18:02:46 +0200 |
commit | 355800f8147b1755a5289dc679e2147abd662daf (patch) | |
tree | 6968e9518c983c84296e94af74e4089bedb45642 /src/configs/meson.rs | |
parent | 41070313311318f02d25b3b85fd3476b61ab8375 (diff) |
feat(module): Add a meson devenv indicator (#4389)
* feat(module): Add a meson devenv indicator
Adds a Meson Developer Environment indicator, if the MESON_DEVENV
variable is set. Inside a `meson devenv`, the prompt will include the
current Meson project name
This also contains a new Truncate utility function, which may be adapted for other modules in the future
* docs: Add Meson to presets
Diffstat (limited to 'src/configs/meson.rs')
-rw-r--r-- | src/configs/meson.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/configs/meson.rs b/src/configs/meson.rs new file mode 100644 index 000000000..0325c3f56 --- /dev/null +++ b/src/configs/meson.rs @@ -0,0 +1,30 @@ +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Deserialize, Serialize)] +#[cfg_attr( + feature = "config-schema", + derive(schemars::JsonSchema), + schemars(deny_unknown_fields) +)] +#[serde(default)] +pub struct MesonConfig<'a> { + pub truncation_length: u32, + pub truncation_symbol: &'a str, + pub format: &'a str, + pub symbol: &'a str, + pub style: &'a str, + pub disabled: bool, +} + +impl<'a> Default for MesonConfig<'a> { + fn default() -> Self { + MesonConfig { + truncation_length: std::u32::MAX, + truncation_symbol: "…", + format: "via [$symbol$project]($style) ", + symbol: "⬢ ", + style: "blue bold", + disabled: false, + } + } +} |