diff options
| author | Jad Altahan <xviyy@aol.com> | 2019-01-29 09:18:07 +1100 |
|---|---|---|
| committer | Jad Altahan <xviyy@aol.com> | 2019-01-29 09:18:07 +1100 |
| commit | a207c0aa819f933567139c5f5b5625e5f659c3d2 (patch) | |
| tree | eac9de905dd919555a6dea589a09eb62ed49f974 /lexers/LexNim.cxx | |
| parent | 38eaf3e8dd62005ee858b7b3d0e8a345bd8cdd05 (diff) | |
| download | scintilla-mirror-a207c0aa819f933567139c5f5b5625e5f659c3d2.tar.gz | |
Backport: Feature [feature-requests:#1260]. Fix inconsistency with dot styling in Nim.
Backport of changeset 7240:99281d1bec87.
Diffstat (limited to 'lexers/LexNim.cxx')
| -rw-r--r-- | lexers/LexNim.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lexers/LexNim.cxx b/lexers/LexNim.cxx index c74c1a965..c85efd293 100644 --- a/lexers/LexNim.cxx +++ b/lexers/LexNim.cxx @@ -424,13 +424,17 @@ void SCI_METHOD LexerNim::Lex(Sci_PositionU startPos, Sci_Position length, sc.SetState(SCE_NIM_DEFAULT); break; case SCE_NIM_IDENTIFIER: - if (!IsAWordChar(sc.ch)) { + if (sc.ch == '.' || !IsAWordChar(sc.ch)) { char s[100]; sc.GetCurrent(s, sizeof(s)); int style = SCE_NIM_IDENTIFIER; if (keywords.InList(s) && !funcNameExists) { - style = SCE_NIM_WORD; + // Prevent styling keywords if they are sub-identifiers + Sci_Position segStart = styler.GetStartSegment() - 1; + if (segStart < 0 || styler.SafeGetCharAt(segStart, '\0') != '.') { + style = SCE_NIM_WORD; + } } else if (funcNameExists) { style = SCE_NIM_FUNCNAME; } |
