From f8ab86f9302b3544c093e3a843a9506da0ccd512 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 31 Oct 2024 22:24:24 -0600 Subject: [PATCH] Simplify line normalization (#19712) Release Notes: - Added \u2028 and \u2029 to invisible characters. Previously these were treated as \n. --- crates/text/src/text.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/text/src/text.rs b/crates/text/src/text.rs index 380ced5253..1d214fe0e1 100644 --- a/crates/text/src/text.rs +++ b/crates/text/src/text.rs @@ -43,9 +43,8 @@ use undo_map::UndoMap; #[cfg(any(test, feature = "test-support"))] use util::RandomCharIter; -static LINE_SEPARATORS_REGEX: LazyLock = LazyLock::new(|| { - Regex::new(r"\r\n|\r|\u{2028}|\u{2029}").expect("Failed to create LINE_SEPARATORS_REGEX") -}); +static LINE_SEPARATORS_REGEX: LazyLock = + LazyLock::new(|| Regex::new(r"\r\n|\r").expect("Failed to create LINE_SEPARATORS_REGEX")); pub type TransactionId = clock::Lamport;