aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/data.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-03-10 10:18:44 +0100
committerGitHub <noreply@github.com>2026-03-10 10:18:44 +0100
commit2035e052f38a738639840a685ddc6a107ea11136 (patch)
tree45f901bd2f670ec4e865e9e6570ca1fa6a67c8a0 /zellij-utils/src/data.rs
parentallow specifying ip/port with the zellij web --status cli (#4825) (diff)
downloadsl0ppij-2035e052f38a738639840a685ddc6a107ea11136.tar.gz
sl0ppij-2035e052f38a738639840a685ddc6a107ea11136.tar.xz
sl0ppij-2035e052f38a738639840a685ddc6a107ea11136.zip
Highlight priority levels (#4827)
* highlight priority levels * add pr
Diffstat (limited to 'zellij-utils/src/data.rs')
-rw-r--r--zellij-utils/src/data.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/zellij-utils/src/data.rs b/zellij-utils/src/data.rs
index 70435bac..724f0abf 100644
--- a/zellij-utils/src/data.rs
+++ b/zellij-utils/src/data.rs
@@ -1203,6 +1203,23 @@ impl Default for PaletteColor {
}
}
+/// Priority layer for plugin-supplied regex highlights.
+/// Higher-priority layers take visual precedence over lower ones
+/// when highlights overlap. Built-in highlights (mouse selection,
+/// search results) always take precedence over all plugin layers.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize)]
+pub enum HighlightLayer {
+ Hint, // lowest: pure pattern matching (paths, URLs, IPs)
+ Tool, // middle: backed by runtime domain knowledge (git, docker, k8s)
+ ActionFeedback, // highest: result of an explicit user action (search, bookmarks)
+}
+
+impl Default for HighlightLayer {
+ fn default() -> Self {
+ HighlightLayer::Hint
+ }
+}
+
/// Style for a plugin-supplied regex highlight.
/// Theme-based variants reference `style.colors.text_unselected.*`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@@ -1231,6 +1248,7 @@ pub enum HighlightStyle {
pub struct RegexHighlight {
pub pattern: String, // key for upsert; also the regex source
pub style: HighlightStyle,
+ pub layer: HighlightLayer,
pub context: BTreeMap<String, String>, // arbitrary data echoed back verbatim on click
pub on_hover: bool, // if true, only rendered when the cursor overlaps this match
pub bold: bool,