diff options
author | Zufu Liu <unknown> | 2021-10-21 22:15:57 +1100 |
---|---|---|
committer | Zufu Liu <unknown> | 2021-10-21 22:15:57 +1100 |
commit | 9975609bf3b39f0e1cd121995ac49aea30a6c48f (patch) | |
tree | 339887d2052a909480b4e3b4df12f318bbec2be8 /src/CharacterType.h | |
parent | a989b1ed63c7cf81c693da8f2f66ab5e29ee341a (diff) | |
download | scintilla-mirror-9975609bf3b39f0e1cd121995ac49aea30a6c48f.tar.gz |
Feature [feature-requests:#1417] Use backward iteration to find space / control
character and text / punctuation boundaries in SafeSegment as will be simpler
and faster in almost all cases.
Simplify BreakFinder::Next calling SafeSegment.
Diffstat (limited to 'src/CharacterType.h')
-rw-r--r-- | src/CharacterType.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/CharacterType.h b/src/CharacterType.h index b014f1050..437fb8c5c 100644 --- a/src/CharacterType.h +++ b/src/CharacterType.h @@ -32,6 +32,13 @@ constexpr bool IsEOLCharacter(int ch) noexcept { return ch == '\r' || ch == '\n'; } +constexpr bool IsBreakSpace(int ch) noexcept { + // used for text breaking, treat C0 control character as space. + // by default C0 control character is handled as special representation, + // so not appears in normal text. 0x7F DEL is omitted to simplify the code. + return ch >= 0 && ch <= ' '; +} + constexpr bool IsADigit(int ch) noexcept { return (ch >= '0') && (ch <= '9'); } |