public enum Flags
{
None = 0x00,
+
/// A text inserted before a character that has this property
/// inherits this property. If the text already has properties
- /// of the same key, they are deleted.
+ /// of the same key, they are deleted at first.
FrontSticky = 0x01,
+
/// A text inserted after a character that has this property
/// inherits this property. If the text already has properties
- /// of the same key, they are deleted.
+ /// of the same key, they are deleted at first.
RearSticky = 0x02,
+
/// This property is deleted from a span of text if the span is
/// modified (i.e. a character is changed, a text is inserted,
- /// some part is deleted). This propery is also deleted if a
+ /// some part is deleted). This property is also deleted if a
/// property of the same key is added, which means that this
- /// property is not stackable.
+ /// property is not stackable. In addition this property is
+ /// never merged with the same value of preceding or following
+ /// property.
Sensitive = 0x04,
+
/// Like Sensitive but also this property is deleted from a span
/// of text if a text just before the span is modified,
/// inserted, or deleted.
- FrontSensitive = 0x08,
+ FrontSensitive = 0x0C,
+
/// Like Sensitive but also this property is deleted from a span
/// of text if a text just after the span is modified, inserted,
/// or deleted.
- RearSensitive = 0x10
+ RearSensitive = 0x14,
};
internal MSymbol key;
MProperty.Flags.RearSensitive) ; }
}
- public bool isAnySensitive
- {
- get { return MProperty.HasFlags (Key,
- (MProperty.Flags.Sensitive
- | MProperty.Flags.RearSensitive
- | MProperty.Flags.FrontSensitive)) ; }
- }
-
private void update_from_to ()
{
if (Parent == null)
MInterval tail = find_tail (end);
if (! head.Stack.IsEmpty
- && (isAnySensitive && head.From < start
+ && ((isSensitive || isFrontSensitive) && head.From < start
|| isFrontSensitive && ! first))
{
head = copy.find_head (0);
head.Stack.Clear ();
}
if (! tail.Stack.IsEmpty
- && (isAnySensitive && end < head.To
+ && ((isSensitive || isRearSensitive) && end < head.To
|| isRearSensitive && ! last))
{
tail = copy.find_tail (copy.Length);
{
int len = end - start;
- if (isAnySensitive)
- Stack.Clear ();
+ if (isSensitive
+ || (From < start && isRearSensitive)
+ || (end < To && isFrontSensitive))
+ {
+ M17n.DebugPrint ("clear this stack\n");
+ Stack.Clear ();
+ }
for (MInterval i = this; i != null; i = i.Parent)
i.Length -= len;
}
end = To;
}
- if (! Stack.IsEmpty && isAnySensitive)
+ if (! Stack.IsEmpty && isSensitive)
Stack.Clear ();
if (start > From)
divide_left (start);
if (! Stack.IsEmpty)
{
- if (isAnySensitive)
+ if (isSensitive)
Stack.Clear ();
else
{