diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2018-05-21 15:15:34 +1000 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2018-05-21 15:15:34 +1000 |
commit | 521ef7054806424c97dac5ee71b3a05ed5b9d7f4 (patch) | |
tree | d46c95588195f593baa1c46b0882e1c169b6b590 /src/PositionCache.cxx | |
parent | 150417216d362bae78621939102f8183af951f78 (diff) | |
download | scintilla-mirror-521ef7054806424c97dac5ee71b3a05ed5b9d7f4.tar.gz |
Draw invalid bytes in DBCS when detected as blobs in a similar way to UTF-8.
Diffstat (limited to 'src/PositionCache.cxx')
-rw-r--r-- | src/PositionCache.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index bf5560678..31a8601f5 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -508,7 +508,8 @@ TextSegment BreakFinder::Next() { charWidth = UTF8DrawBytes(reinterpret_cast<unsigned char *>(&ll->chars[nextBreak]), static_cast<int>(lineRange.end - nextBreak)); else if (encodingFamily == efDBCS) - charWidth = pdoc->IsDBCSLeadByteNoExcept(ll->chars[nextBreak]) ? 2 : 1; + charWidth = pdoc->DBCSDrawBytes( + std::string_view(&ll->chars[nextBreak], lineRange.end - nextBreak)); const Representation *repr = preprs->RepresentationFromCharacter(&ll->chars[nextBreak], charWidth); if (((nextBreak > 0) && (ll->styles[nextBreak] != ll->styles[nextBreak - 1])) || repr || |