diff options
| author | Neil <nyamatongwe@gmail.com> | 2019-04-25 11:11:19 +1000 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2019-04-25 11:11:19 +1000 | 
| commit | 749af53f4ce6b6701f307750614f81fe59fae9a6 (patch) | |
| tree | 64626b8ec78d65e5a2bcaf9de4f0d8dfdb2dd7bc /lexlib/SubStyles.h | |
| parent | 34d3c3e8695de9eb5f2ad37ff288cfa3ab2f3185 (diff) | |
| download | scintilla-mirror-749af53f4ce6b6701f307750614f81fe59fae9a6.tar.gz | |
Fix bug where changing identifier sets in lexers preserved previous identifiers.
Diffstat (limited to 'lexlib/SubStyles.h')
| -rw-r--r-- | lexlib/SubStyles.h | 12 | 
1 files changed, 12 insertions, 0 deletions
| diff --git a/lexlib/SubStyles.h b/lexlib/SubStyles.h index 3e99efe83..f9bdfe65c 100644 --- a/lexlib/SubStyles.h +++ b/lexlib/SubStyles.h @@ -61,7 +61,19 @@ public:  		return (style >= firstStyle) && (style < (firstStyle + lenStyles));  	} +	void RemoveStyle(int style) { +		std::map<std::string, int>::iterator it = wordToStyle.begin(); +		while (it != wordToStyle.end()) { +			if (it->second == style) { +				it = wordToStyle.erase(it); +			} else { +				++it; +			} +		} +	} +  	void SetIdentifiers(int style, const char *identifiers) { +		RemoveStyle(style);  		while (*identifiers) {  			const char *cpSpace = identifiers;  			while (*cpSpace && !(*cpSpace == ' ' || *cpSpace == '\t' || *cpSpace == '\r' || *cpSpace == '\n')) | 
