diff options
| author | nyamatongwe <devnull@localhost> | 2003-09-28 22:06:23 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2003-09-28 22:06:23 +0000 | 
| commit | e098d9e7420a8deec3db17df31d9d7bb4dbcf22b (patch) | |
| tree | 08e41dc38284608575f3bc1dbc375502ce65ecb5 /src/Document.cxx | |
| parent | 11b58966dcd5909f1fbd22def7f9888893bdd16f (diff) | |
| download | scintilla-mirror-e098d9e7420a8deec3db17df31d9d7bb4dbcf22b.tar.gz | |
Hotspot improvements from Simon, including setting to
limit hotspots to a single line.
Diffstat (limited to 'src/Document.cxx')
| -rw-r--r-- | src/Document.cxx | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/src/Document.cxx b/src/Document.cxx index 3f14335c0..7f4893711 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1335,14 +1335,18 @@ int Document::WordPartRight(int pos) {  	return pos;  } -int Document::ExtendStyleRange(int pos, int delta) { +bool IsLineEndChar(char c) { +	return (c == '\n' || c == '\r'); +} + +int Document::ExtendStyleRange(int pos, int delta, bool singleLine) {  	int sStart = cb.StyleAt(pos);  	if (delta < 0) { -		while (pos > 0 && (cb.StyleAt(pos) == sStart)) +		while (pos > 0 && (cb.StyleAt(pos) == sStart) && (!singleLine || !IsLineEndChar(cb.CharAt(pos))) )  			pos--;  		pos++;  	} else { -		while (pos < (Length()) && (cb.StyleAt(pos) == sStart)) +		while (pos < (Length()) && (cb.StyleAt(pos) == sStart) && (!singleLine || !IsLineEndChar(cb.CharAt(pos))) )  			pos++;  	}  	return pos; | 
