Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Escaped backslash in string confuse editor [bug]
Escaped backslash in string confuse editor [bug] [message #11751] Mon, 24 September 2007 23:06 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
In a statement like this :

while(i < 10)
{
if(Line.Find("\\"))
break;
}


the parenthesis match is broken in editor.

ciao

Max

Re: Escaped backslash in string confuse editor [bug] [message #11768 is a reply to message #11751] Tue, 25 September 2007 14:24 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Just tried, seems to be ok (?)
Re: Escaped backslash in string confuse editor [bug] [message #11770 is a reply to message #11751] Tue, 25 September 2007 14:54 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Nope....
index.php?t=getfile&id=736&private=0
Re: Escaped backslash in string confuse editor [bug] [message #11771 is a reply to message #11770] Tue, 25 September 2007 15:15 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Ah, I was looking for the color of text (parenthesis color), not match paper highlight...

Thanks,

Mirek
Re: Escaped backslash in string confuse editor [bug] [message #11772 is a reply to message #11771] Tue, 25 September 2007 15:28 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
uh ? It's the parenthesis color (and count) that is mistaken, you see in my example, you pair a ')' with a '{', I guess because of the second '\' taken as escape char and not as a literal '\'.

BTW, I didn't notice before the paper colour.... and I was asking myself why code in theide editor is so well readable Very Happy
Nice idea, that one, really!

Ciao

Max
Re: Escaped backslash in string confuse editor [bug] [message #11773 is a reply to message #11772] Tue, 25 September 2007 16:01 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, neverming how do you want to call that color, it is now fixed...Smile

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 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
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...Smile

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 Go to previous message
mirek is currently offline  mirek
Messages: 13975
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...Smile

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

Previous Topic: Layout Editor : second impression and.. [FEATURE REQUEST]
Next Topic: Very first impressions and.... [FEATURE REQUESTS]
Goto Forum:
  


Current Time: Fri Mar 29 08:37:35 CET 2024

Total time taken to generate the page: 0.02330 seconds