aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexPython.cxx
diff options
context:
space:
mode:
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);