summaryrefslogtreecommitdiffstats
path: root/scintilla/lexers/LexPython.cxx
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2011-04-16 10:31:38 +0000
committerXhmikosR <xhmikosr@users.sourceforge.net>2011-04-16 10:31:38 +0000
commitf3184f8ed9b54c016ccfb58ca674a8872da7ed05 (patch)
treef41ed8fa6cb2ed1d6a658ceb1d2870fc722588b0 /scintilla/lexers/LexPython.cxx
parent19a47f7955117520cc2191a3ab17db86b863818d (diff)
downloadnotepad2-mod-f3184f8ed9b54c016ccfb58ca674a8872da7ed05.zip
notepad2-mod-f3184f8ed9b54c016ccfb58ca674a8872da7ed05.tar.gz
notepad2-mod-f3184f8ed9b54c016ccfb58ca674a8872da7ed05.tar.bz2
update scintilla
git-svn-id: https://notepad2-mod.googlecode.com/svn/trunk@471 28bd50df-7adb-d945-0439-6e466c6a13cc
Diffstat (limited to 'scintilla/lexers/LexPython.cxx')
-rw-r--r--scintilla/lexers/LexPython.cxx14
1 files changed, 8 insertions, 6 deletions
diff --git a/scintilla/lexers/LexPython.cxx b/scintilla/lexers/LexPython.cxx
index 2ce8146..cedf7d6 100644
--- a/scintilla/lexers/LexPython.cxx
+++ b/scintilla/lexers/LexPython.cxx
@@ -28,7 +28,7 @@ using namespace Scintilla;
#endif
/* kwCDef, kwCTypeName only used for Cython */
-enum kwType { kwOther, kwClass, kwDef, kwImport, kwCDef, kwCTypeName };
+enum kwType { kwOther, kwClass, kwDef, kwImport, kwCDef, kwCTypeName, kwCPDef };
static const int indicatorWhitespace = 1;
@@ -246,7 +246,7 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
style = SCE_P_CLASSNAME;
} else if (kwLast == kwDef) {
style = SCE_P_DEFNAME;
- } else if (kwLast == kwCDef) {
+ } else if (kwLast == kwCDef || kwLast == kwCPDef) {
int pos = sc.currentPos;
unsigned char ch = styler.SafeGetCharAt(pos, '\0');
while (ch != '\0') {
@@ -277,11 +277,13 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
kwLast = kwImport;
else if (0 == strcmp(s, "cdef"))
kwLast = kwCDef;
+ else if (0 == strcmp(s, "cpdef"))
+ kwLast = kwCPDef;
else if (0 == strcmp(s, "cimport"))
kwLast = kwImport;
- else if (kwLast != kwCDef)
+ else if (kwLast != kwCDef && kwLast != kwCPDef)
kwLast = kwOther;
- } else if (kwLast != kwCDef) {
+ } else if (kwLast != kwCDef && kwLast != kwCPDef) {
kwLast = kwOther;
}
}
@@ -337,8 +339,8 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
indentGood = true;
}
- // One cdef line, clear kwLast only at end of line
- if (kwLast == kwCDef && sc.atLineEnd) {
+ // One cdef or cpdef line, clear kwLast only at end of line
+ if ((kwLast == kwCDef || kwLast == kwCPDef) && sc.atLineEnd) {
kwLast = kwOther;
}