aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-03-28 08:41:26 +1100
committerNeil <nyamatongwe@gmail.com>2014-03-28 08:41:26 +1100
commit21a157cd9661afeb7ad4471b37375a030b0f1658 (patch)
treed3f7d600858fb5e2a6e680ee0d63b95adee070e9 /src
parent44dcbf55f6722732795743b1528d079dc51d0de5 (diff)
downloadscintilla-mirror-21a157cd9661afeb7ad4471b37375a030b0f1658.tar.gz
Displaying Unicode line ends as [LS], [PS], and [NEL] blobs.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 6381f7eab..1337a0e05 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -273,6 +273,8 @@ void Editor::SetRepresentations() {
char c1[3] = { '\xc2', static_cast<char>(0x80+j), 0 };
reprs.SetRepresentation(c1, repsC1[j]);
}
+ reprs.SetRepresentation("\xe2\x80\xa8", "LS");
+ reprs.SetRepresentation("\xe2\x80\xa9", "PS");
}
// UTF-8 invalid bytes
@@ -2555,14 +2557,20 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin
char hexits[4];
const char *ctrlChar;
unsigned char chEOL = ll->chars[eolPos];
+ int styleMain = ll->styles[eolPos];
+ ColourDesired textBack = TextBackground(vsDraw, overrideBackground, background, eolInSelection, false, styleMain, eolPos, ll);
if (UTF8IsAscii(chEOL)) {
ctrlChar = ControlCharacterString(chEOL);
} else {
- sprintf(hexits, "x%2X", chEOL);
- ctrlChar = hexits;
+ Representation *repr = reprs.RepresentationFromCharacter(ll->chars + eolPos, ll->numCharsInLine - eolPos);
+ if (repr) {
+ ctrlChar = repr->stringRep.c_str();
+ eolPos = ll->numCharsInLine;
+ } else {
+ sprintf(hexits, "x%2X", chEOL);
+ ctrlChar = hexits;
+ }
}
- int styleMain = ll->styles[eolPos];
- ColourDesired textBack = TextBackground(vsDraw, overrideBackground, background, eolInSelection, false, styleMain, eolPos, ll);
ColourDesired textFore = vsDraw.styles[styleMain].fore;
if (eolInSelection && vsDraw.selColours.fore.isSet) {
textFore = (eolInSelection == 1) ? vsDraw.selColours.fore : vsDraw.selAdditionalForeground;