improve merging of snips when a style change is applied to a range (as by the syntax colorer)
svn: r4871
This commit is contained in:
parent
417262513b
commit
c0268de2f3
|
@ -235,7 +235,7 @@ void wxMediaEdit::_ChangeStyle(long start, long end,
|
||||||
wxSnip *gsnip, *startSnip, *endSnip;
|
wxSnip *gsnip, *startSnip, *endSnip;
|
||||||
wxStyleChangeRecord *rec;
|
wxStyleChangeRecord *rec;
|
||||||
wxStyle *style, *style2, *prev_style;
|
wxStyle *style, *style2, *prev_style;
|
||||||
long p, prev_style_pos;
|
long p, prev_style_pos, extra_check_pos = 0;
|
||||||
int something;
|
int something;
|
||||||
|
|
||||||
if (writeLocked || userLocked)
|
if (writeLocked || userLocked)
|
||||||
|
@ -317,7 +317,9 @@ void wxMediaEdit::_ChangeStyle(long start, long end,
|
||||||
gsnip->style = style2;
|
gsnip->style = style2;
|
||||||
|
|
||||||
if (rec && (style != prev_style)) {
|
if (rec && (style != prev_style)) {
|
||||||
rec->AddStyleChange(prev_style_pos, p, prev_style);
|
if (prev_style) {
|
||||||
|
rec->AddStyleChange(prev_style_pos, p, prev_style);
|
||||||
|
}
|
||||||
prev_style_pos = p;
|
prev_style_pos = p;
|
||||||
prev_style = style;
|
prev_style = style;
|
||||||
}
|
}
|
||||||
|
@ -327,6 +329,8 @@ void wxMediaEdit::_ChangeStyle(long start, long end,
|
||||||
if (maxWidth > 0)
|
if (maxWidth > 0)
|
||||||
gsnip->line->MarkCheckFlow();
|
gsnip->line->MarkCheckFlow();
|
||||||
|
|
||||||
|
extra_check_pos = p;
|
||||||
|
|
||||||
something = TRUE;
|
something = TRUE;
|
||||||
} else if (rec && prev_style) {
|
} else if (rec && prev_style) {
|
||||||
rec->AddStyleChange(prev_style_pos, p, prev_style);
|
rec->AddStyleChange(prev_style_pos, p, prev_style);
|
||||||
|
@ -356,7 +360,10 @@ void wxMediaEdit::_ChangeStyle(long start, long end,
|
||||||
delayedStreak = TRUE;
|
delayedStreak = TRUE;
|
||||||
|
|
||||||
CheckMergeSnips(start);
|
CheckMergeSnips(start);
|
||||||
CheckMergeSnips(end);
|
if (extra_check_pos)
|
||||||
|
CheckMergeSnips(extra_check_pos);
|
||||||
|
if (extra_check_pos != end)
|
||||||
|
CheckMergeSnips(end);
|
||||||
|
|
||||||
if (!modified && counts_as_mod)
|
if (!modified && counts_as_mod)
|
||||||
SetModified(TRUE);
|
SetModified(TRUE);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user