diff options
author | Neil <nyamatongwe@gmail.com> | 2023-02-12 12:01:21 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2023-02-12 12:01:21 +1100 |
commit | 80a1e22a987c4e749dd03500edc3ac4e189537c5 (patch) | |
tree | 1dc58be5e57c8c77036e2201806ac7f20dd38dfb /src/Editor.cxx | |
parent | 1b585d29ad82606c327294837e27ffcd7a66172b (diff) | |
download | scintilla-mirror-80a1e22a987c4e749dd03500edc3ac4e189537c5.tar.gz |
Feature [feature-requests:#1476] Move default representation code into
SpecialRepresentations class.
Diffstat (limited to 'src/Editor.cxx')
-rw-r--r-- | src/Editor.cxx | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 273d6db2a..7144a422d 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -212,50 +212,7 @@ void Editor::Finalise() { } void Editor::SetRepresentations() { - reprs.Clear(); - - // C0 control set - const char *const reps[] = { - "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", - "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", - "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", - "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US" - }; - for (size_t j=0; j < std::size(reps); j++) { - const char c[2] = { static_cast<char>(j), 0 }; - reprs.SetRepresentation(std::string_view(c, 1), reps[j]); - } - reprs.SetRepresentation("\x7f", "DEL"); - - const int dbcsCodePage = pdoc->dbcsCodePage; - // C1 control set - // As well as Unicode mode, ISO-8859-1 should use these - if (CpUtf8 == dbcsCodePage) { - const char *const repsC1[] = { - "PAD", "HOP", "BPH", "NBH", "IND", "NEL", "SSA", "ESA", - "HTS", "HTJ", "VTS", "PLD", "PLU", "RI", "SS2", "SS3", - "DCS", "PU1", "PU2", "STS", "CCH", "MW", "SPA", "EPA", - "SOS", "SGCI", "SCI", "CSI", "ST", "OSC", "PM", "APC" - }; - for (size_t j=0; j < std::size(repsC1); j++) { - const 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"); - } - - // Invalid as single bytes in multi-byte encodings - if (dbcsCodePage) { - for (int k = 0x80; k < 0x100; k++) { - if ((CpUtf8 == dbcsCodePage) || !IsDBCSValidSingleByte(dbcsCodePage, k)) { - const char hiByte[2] = { static_cast<char>(k), 0 }; - char hexits[4]; - Hexits(hexits, k); - reprs.SetRepresentation(hiByte, hexits); - } - } - } + reprs.SetDefaultRepresentations(pdoc->dbcsCodePage); } void Editor::DropGraphics() noexcept { |