diff options
author | Neil <nyamatongwe@gmail.com> | 2021-06-03 20:24:44 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-06-03 20:24:44 +1000 |
commit | f997170c3eb0afa64d10b39b86799bad67dc5c02 (patch) | |
tree | a0ec6b193f9315452237c89107eb552bf77298a4 /src/PositionCache.h | |
parent | aeb285c6677ebb1d940d2a4d8e6992697ed263c8 (diff) | |
download | scintilla-mirror-f997170c3eb0afa64d10b39b86799bad67dc5c02.tar.gz |
Add APIs for setting appearance (traditional blob or plain text) and colour of
representations and support setting a representation for the "\r\n" line end
sequence.
Diffstat (limited to 'src/PositionCache.h')
-rw-r--r-- | src/PositionCache.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/PositionCache.h b/src/PositionCache.h index 16ac42ef8..b3e87bcd5 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -199,7 +199,10 @@ public: class Representation { public: std::string stringRep; - explicit Representation(const char *value="") : stringRep(value) { + RepresentationAppearance appearance; + ColourRGBA colour; + explicit Representation(std::string_view value="", RepresentationAppearance appearance_= RepresentationAppearance::Blob) : + stringRep(value), appearance(appearance_) { } }; @@ -207,13 +210,14 @@ typedef std::map<unsigned int, Representation> MapRepresentation; class SpecialRepresentations { MapRepresentation mapReprs; - short startByteHasReprs[0x100]; + short startByteHasReprs[0x100] {}; public: - SpecialRepresentations(); - void SetRepresentation(const char *charBytes, const char *value); - void ClearRepresentation(const char *charBytes); - const Representation *RepresentationFromCharacter(const char *charBytes, size_t len) const; - bool Contains(const char *charBytes, size_t len) const; + 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 *RepresentationFromCharacter(std::string_view charBytes) const; + bool Contains(std::string_view charBytes) const; void Clear(); }; |