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: 14038 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;
}
}
|
|
|
Re: Escaped backslash in string confuse editor [bug] [message #11776 is a reply to message #11773] |
Tue, 25 September 2007 16:47 |
mdelfede
Messages: 1308 Registered: September 2007
|
Ultimate Contributor |
|
|
luzr wrote on Tue, 25 September 2007 16:01 | Well, neverming how do you want to call that color, it is now fixed...
Quick fix: (would be nice to test it thoroughly...):
|
I'd like to test it, but svn release is really too buggy to use on Linux, I stopped doing it. If you want I can test the workaround recompiling 2007.1 release (which works like a charm on Linux)... I don't know if your patch is compatible with it.
BTW, i wanted to ask you since some days... the svn is the up-to-date development version, or is an outdated one ? and, if it's outdated, there's some way to stay in sync with latest devel versions ?
Ciao
Max
|
|
|
Re: Escaped backslash in string confuse editor [bug] [message #11781 is a reply to message #11776] |
Tue, 25 September 2007 18:12 |
|
mirek
Messages: 14038 Registered: November 2005
|
Ultimate Member |
|
|
mdelfede wrote on Tue, 25 September 2007 10:47 |
luzr wrote on Tue, 25 September 2007 16:01 | Well, neverming how do you want to call that color, it is now fixed...
Quick fix: (would be nice to test it thoroughly...):
|
I'd like to test it, but svn release is really too buggy to use on Linux, I stopped doing it. If you want I can test the workaround recompiling 2007.1 release (which works like a charm on Linux)... I don't know if your patch is compatible with it.
|
Yes, I believe so.
Quote: |
BTW, i wanted to ask you since some days... the svn is the up-to-date development version, or is an outdated one ? and, if it's outdated, there's some way to stay in sync with latest devel versions ?
|
Usually SVN lags.
Mirek
[Updated on: Tue, 25 September 2007 18:13] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri Sep 20 03:51:45 CEST 2024
Total time taken to generate the page: 0.04196 seconds
|