diff options
| author | Zufu Liu <unknown> | 2021-07-29 09:23:11 +1000 | 
|---|---|---|
| committer | Zufu Liu <unknown> | 2021-07-29 09:23:11 +1000 | 
| commit | ff085a4ce95380e9d981e0170e2d1eeaa93fdb88 (patch) | |
| tree | a290341caea8722cd045d676ae5347aa50ec03a5 /src/PositionCache.h | |
| parent | 884df029d33db4f93557885fb5020e5cdc9e8a9d (diff) | |
| download | scintilla-mirror-ff085a4ce95380e9d981e0170e2d1eeaa93fdb88.tar.gz | |
Feature [feature-requests:#1413] Decrease cost of representation for \r\n.
Diffstat (limited to 'src/PositionCache.h')
| -rw-r--r-- | src/PositionCache.h | 8 | 
1 files changed, 8 insertions, 0 deletions
| diff --git a/src/PositionCache.h b/src/PositionCache.h index b628b0421..0eefaca78 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -212,13 +212,21 @@ typedef std::map<unsigned int, Representation> MapRepresentation;  class SpecialRepresentations {  	MapRepresentation mapReprs;  	short startByteHasReprs[0x100] {}; +	bool crlf = false;  public:  	void SetRepresentation(std::string_view charBytes, std::string_view value);  	void SetRepresentationAppearance(std::string_view charBytes, RepresentationAppearance appearance);  	void SetRepresentationColour(std::string_view charBytes, ColourRGBA colour);  	void ClearRepresentation(std::string_view charBytes); +	const Representation *GetRepresentation(std::string_view charBytes) const;  	const Representation *RepresentationFromCharacter(std::string_view charBytes) const;  	bool Contains(std::string_view charBytes) const; +	bool ContainsCrLf() const noexcept { +		return crlf; +	} +	bool MayContain(unsigned char ch) const noexcept { +		return startByteHasReprs[ch] != 0; +	}  	void Clear();  }; | 
