aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/CharacterType.h
diff options
context:
space:
mode:
authorZufu Liu <unknown>2021-10-21 22:15:57 +1100
committerZufu Liu <unknown>2021-10-21 22:15:57 +1100
commit9975609bf3b39f0e1cd121995ac49aea30a6c48f (patch)
tree339887d2052a909480b4e3b4df12f318bbec2be8 /src/CharacterType.h
parenta989b1ed63c7cf81c693da8f2f66ab5e29ee341a (diff)
downloadscintilla-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.h7
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');
}