From 5b098c3fd8212cee632b9e18a8667f8b59b78365 Mon Sep 17 00:00:00 2001
From: Pascal Kuthe
Date: Thu, 29 Sep 2022 17:05:10 +0200
Subject: [PATCH 1/9] implement consistent behaviour for highlight overlays
---
helix-core/src/syntax.rs | 173 ++++--------------
helix-core/src/syntax/overlay.rs | 254 ++++++++++++++++++++++++++
helix-core/src/syntax/overlay/test.rs | 32 ++++
helix-term/src/ui/editor.rs | 218 +++++++++++++---------
helix-term/src/ui/lsp.rs | 17 +-
helix-term/src/ui/markdown.rs | 14 +-
helix-term/src/ui/picker.rs | 33 ++--
7 files changed, 487 insertions(+), 254 deletions(-)
create mode 100644 helix-core/src/syntax/overlay.rs
create mode 100644 helix-core/src/syntax/overlay/test.rs
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index e0a984d20d29..d3f4e7a2d0fa 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -2,10 +2,12 @@ use crate::{
auto_pairs::AutoPairs,
chars::char_is_line_ending,
diagnostic::Severity,
+ graphemes::ensure_grapheme_boundary_next_byte,
regex::Regex,
transaction::{ChangeSet, Operation},
Rope, RopeSlice, Tendril,
};
+pub use overlay::{monotonic_overlay, overlapping_overlay, Span};
use arc_swap::{ArcSwap, Guard};
use slotmap::{DefaultKey as LayerId, HopSlotMap};
@@ -25,6 +27,8 @@ use serde::{Deserialize, Serialize};
use helix_loader::grammar::{get_language, load_runtime_file};
+mod overlay;
+
fn deserialize_regex<'de, D>(deserializer: D) -> Result