aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexPython.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2011-06-24 09:29:29 +1000
committernyamatongwe <unknown>2011-06-24 09:29:29 +1000
commitac04dd054380d2caea9106cae5083e4d41954594 (patch)
treea560da177574b6eb1bd5319ec355ad53458bfcc1 /lexers/LexPython.cxx
parent4b2e12dcb1ddf814c6e53ace1a1e9446e8590d6a (diff)
downloadscintilla-mirror-ac04dd054380d2caea9106cae5083e4d41954594.tar.gz
LexPython: keywords2: don't highlight sub-identifiers. Bug #3325333.
From Todd Whiteman.
Diffstat (limited to 'lexers/LexPython.cxx')
-rw-r--r--lexers/LexPython.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/lexers/LexPython.cxx b/lexers/LexPython.cxx
index 70db1ecd8..4ed6c92a5 100644
--- a/lexers/LexPython.cxx
+++ b/lexers/LexPython.cxx
@@ -264,7 +264,12 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
}
}
} else if (keywords2.InList(s)) {
- style = SCE_P_WORD2;
+ // We don't want to highlight keywords2
+ // that are used as a sub-identifier,
+ // i.e. not open in "foo.open".
+ int pos = styler.GetStartSegment() - 1;
+ if (pos < 0 || (styler.SafeGetCharAt(pos, '\0') != '.'))
+ style = SCE_P_WORD2;
}
sc.ChangeState(style);
sc.SetState(SCE_P_DEFAULT);