aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/UniConversion.h
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2013-01-19 11:40:47 +1100
committernyamatongwe <devnull@localhost>2013-01-19 11:40:47 +1100
commitd6ac5bf56d40512ac0634d7a5bee6f7328b7d41f (patch)
treec8a0a61379695115cde7c7423ce4308f4c195336 /src/UniConversion.h
parent46ff1fe3d148b9d131788be6b4d7da8daa65189c (diff)
downloadscintilla-mirror-d6ac5bf56d40512ac0634d7a5bee6f7328b7d41f.tar.gz
Support the three Unicode line ends NEL, LS, and PS in CellBuffer, Document,
Editor and the message interface. Will only be turned on for lexers that support Unicode line ends.
Diffstat (limited to 'src/UniConversion.h')
-rw-r--r--src/UniConversion.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/UniConversion.h b/src/UniConversion.h
index 704f16239..70e8a9517 100644
--- a/src/UniConversion.h
+++ b/src/UniConversion.h
@@ -26,3 +26,16 @@ inline bool UTF8IsAscii(int ch) {
enum { UTF8MaskWidth=0x7, UTF8MaskInvalid=0x8 };
int UTF8Classify(const unsigned char *us, int len);
+
+// Line separator is U+2028 \xe2\x80\xa8
+// Paragraph separator is U+2029 \xe2\x80\xa9
+const int UTF8SeparatorLength = 3;
+inline bool UTF8IsSeparator(const unsigned char *us) {
+ return (us[0] == 0xe2) && (us[1] == 0x80) && ((us[2] == 0xa8) || (us[2] == 0xa9));
+}
+
+// NEL is U+0085 \xc2\x85
+const int UTF8NELLength = 2;
+inline bool UTF8IsNEL(const unsigned char *us) {
+ return (us[0] == 0xc2) && (us[1] == 0x85);
+}