From 355800f8147b1755a5289dc679e2147abd662daf Mon Sep 17 00:00:00 2001 From: Jamie Date: Tue, 11 Oct 2022 09:02:46 -0700 Subject: 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 --- src/configs/meson.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/configs/meson.rs (limited to 'src/configs/meson.rs') 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, + } + } +} -- cgit v1.2.3