diff options
| -rw-r--r-- | doc/ScintillaHistory.html | 3 | ||||
| -rw-r--r-- | lexlib/SubStyles.h | 12 | 
2 files changed, 15 insertions, 0 deletions
| diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index d9bdc951b..cff81ed87 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -560,6 +560,9 @@  	<li>  	Released 17 April 2019.  	</li> +	<li> +	Fix bug where changing identifier sets in lexers preserved previous identifiers. +	</li>      </ul>      <h3>         <a href="https://www.scintilla.org/scite415.zip">Release 4.1.5</a> 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')) | 
