diff options
| -rw-r--r-- | src/Document.cxx | 2 | ||||
| -rw-r--r-- | src/Document.h | 3 | ||||
| -rw-r--r-- | src/ScintillaBase.cxx | 15 | 
3 files changed, 14 insertions, 6 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 4b6a448cb..577f70910 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1409,7 +1409,7 @@ bool SCI_METHOD Document::SetStyles(int length, const char *styles) {  void Document::EnsureStyledTo(int pos) {  	if ((enteredStyling == 0) && (pos > GetEndStyled())) {  		IncrementStyleClock(); -		if (pli) { +		if (pli && !pli->UseContainerLexing()) {  			int lineEndStyled = LineFromPosition(GetEndStyled());  			int endStyled = LineStart(lineEndStyled);  			pli->Colourise(endStyled, pos); diff --git a/src/Document.h b/src/Document.h index a765c6299..ffadbade3 100644 --- a/src/Document.h +++ b/src/Document.h @@ -146,6 +146,9 @@ public:  	virtual ~LexInterface() {  	}  	void Colourise(int start, int end); +	bool UseContainerLexing() const { +		return instance == 0; +	}  };  /** diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 2f84db7cd..b4accacb9 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -527,17 +527,22 @@ void LexState::SetLexerModule(const LexerModule *lex) {  			instance = 0;  		}  		lexCurrent = lex; -		instance = lexCurrent->Create(); +		if (lexCurrent) +			instance = lexCurrent->Create();  		pdoc->LexerChanged();  	}  }  void LexState::SetLexer(uptr_t wParam) {  	lexLanguage = wParam; -	const LexerModule *lex = Catalogue::Find(lexLanguage); -	if (!lex) -		lex = Catalogue::Find(SCLEX_NULL); -	SetLexerModule(lex); +	if (lexLanguage == SCLEX_CONTAINER) { +		SetLexerModule(0); +	} else { +		const LexerModule *lex = Catalogue::Find(lexLanguage); +		if (!lex) +			lex = Catalogue::Find(SCLEX_NULL); +		SetLexerModule(lex); +	}  }  void LexState::SetLexerLanguage(const char *languageName) {  | 
