Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Escaped backslash in string confuse editor [bug]
Re: Escaped backslash in string confuse editor [bug] [message #11773 is a reply to message #11772] |
Tue, 25 September 2007 16:01   |
 |
mirek
Messages: 14267 Registered: November 2005
|
Ultimate Member |
|
|
Well, neverming how do you want to call that color, it is now fixed...
Quick fix: (would be nice to test it thoroughly...):
CodeEditor/CodeEditor.cpp:
bool NotEscape(int pos, const WString& s)
{
return pos == 0 || s[pos - 1] != '\\' ? true : !NotEscape(pos - 1, s);
}
void CodeEditor::CheckBracket(int li, int pos, int ppos, int pos0, WString ln, int d, int limit)
{
int li0 = li;
int lvl = 1;
pos += d;
ppos += d;
for(;;) {
int c;
for(;;) {
while(pos < 0 || pos >= ln.GetLength()) {
li += d;
if(d * li >= d * limit)
return;
ln = GetWLine(li);
pos = d < 0 ? ln.GetLength() - 1 : 0;
ppos += d;
}
c = ln[pos];
if((c == '\"' || c == '\'') && (NotEscape(pos, ln) && ln[pos - 1] != '\'')) {
pos += d;
ppos += d;
int lc = c;
while(pos < ln.GetLength() && pos > 0) {
if(ln[pos] == lc && NotEscape(pos, ln)) {
pos += d;
ppos += d;
break;
}
pos += d;
ppos += d;
}
}
else
break;
}
if(islbrkt(c))
lvl += d;
if(isrbrkt(c))
lvl -= d;
if(lvl <= 0) {
highlight_bracket_pos0 = pos0;
highlight_bracket_pos = ppos;
RefreshLine(li);
RefreshLine(li0);
bracket_start = GetTimeClick();
return;
}
pos += d;
ppos += d;
}
}
|
|
|
Goto Forum:
Current Time: Mon Aug 04 18:41:39 CEST 2025
Total time taken to generate the page: 0.06686 seconds
|