diff options
Diffstat (limited to 'src/Document.cxx')
| -rw-r--r-- | src/Document.cxx | 12 | 
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index fb28144dd..9f5018c7e 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1246,10 +1246,7 @@ bool Document::SetStyles(int length, char *styles) {  bool Document::EnsureStyledTo(int pos) {  	if (pos > GetEndStyled()) { -		styleClock++; -		if (styleClock > 0x100000) { -			styleClock = 0; -		} +		IncrementStyleClock();  		// Ask the watchers to style, and stop as soon as one responds.  		for (int i = 0; pos > GetEndStyled() && i < lenWatchers; i++) {  			watchers[i].watcher->NotifyStyleNeeded(this, watchers[i].userData, pos); @@ -1258,6 +1255,13 @@ bool Document::EnsureStyledTo(int pos) {  	return pos <= GetEndStyled();  } +void Document::IncrementStyleClock() { +	styleClock++; +	if (styleClock > 0x100000) { +		styleClock = 0; +	} +} +  bool Document::AddWatcher(DocWatcher *watcher, void *userData) {  	for (int i = 0; i < lenWatchers; i++) {  		if ((watchers[i].watcher == watcher) &&  | 
