diff options
author | nyamatongwe <devnull@localhost> | 2011-06-24 09:29:29 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2011-06-24 09:29:29 +1000 |
commit | 729282af00ec46c46d6ee6688273d8d6042a0ac8 (patch) | |
tree | dcb524d5e78318580b90390448101308e817a101 | |
parent | e8775e3e573b6b231221d06ce791b8d22c5e9fdc (diff) | |
download | scintilla-mirror-729282af00ec46c46d6ee6688273d8d6042a0ac8.tar.gz |
LexPython: keywords2: don't highlight sub-identifiers. Bug #3325333.
From Todd Whiteman.
-rw-r--r-- | lexers/LexPython.cxx | 7 |
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); |