Simplify line normalization (#19712)

Release Notes:

- Added \u2028 and \u2029 to invisible characters. Previously these were
treated as \n.
This commit is contained in:
Conrad Irwin 2024-10-31 22:24:24 -06:00 committed by GitHub
parent 155854d9a9
commit f8ab86f930
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,9 +43,8 @@ use undo_map::UndoMap;
#[cfg(any(test, feature = "test-support"))]
use util::RandomCharIter;
static LINE_SEPARATORS_REGEX: LazyLock<Regex> = LazyLock::new(|| {
Regex::new(r"\r\n|\r|\u{2028}|\u{2029}").expect("Failed to create LINE_SEPARATORS_REGEX")
});
static LINE_SEPARATORS_REGEX: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"\r\n|\r").expect("Failed to create LINE_SEPARATORS_REGEX"));
pub type TransactionId = clock::Lamport;