]> O.S.I.I.S - jp/crow.git/commitdiff
TextChange: rw ChangeText, IsEmpty
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 28 Feb 2025 05:13:46 +0000 (06:13 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 28 Feb 2025 05:13:46 +0000 (06:13 +0100)
Crow/src/Text/TextChange.cs

index ae1362a462c960964a0f507de9bdc565b0b86b97..68f4d2c3427399ea979d968b3031f43a670db26e 100644 (file)
@@ -11,12 +11,13 @@ namespace Crow.Text
     {
         public readonly int Start;
         public readonly int Length;
-        public readonly string ChangedText;
+        public string ChangedText;
 
         public int End => Start + Length;
         public int End2 => End + CharDiff;
 
                public int CharDiff => string.IsNullOrEmpty (ChangedText) ? - Length : ChangedText.Length - Length;
+        public bool IsEmpty => string.IsNullOrEmpty (ChangedText) && Length == 0;
         public TextChange (int position, int length, string changedText) {
             Start = position;
             Length = length;