From db5e7b76c0f99ab6476929ac5df170fa51ecc666 Mon Sep 17 00:00:00 2001 From: kudah Date: Sun, 26 May 2013 06:36:49 +0300 Subject: * Fixed a bug in incremental lexing which often caused a full redraw * Don't highlight CPP inside comments when styling.within.preprocessor is on, to avoid incoherent coloring. --- lexers/LexHaskell.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lexers/LexHaskell.cxx b/lexers/LexHaskell.cxx index e56906b81..9b4ad14e9 100644 --- a/lexers/LexHaskell.cxx +++ b/lexers/LexHaskell.cxx @@ -597,7 +597,8 @@ void SCI_METHOD LexerHaskell::Lex(unsigned int startPos, int length, int initSty hs.lmode = LITERATE_BIRD; } // Preprocessor - else if (sc.atLineStart && sc.ch == '#' && options.cpp) { + else if (sc.atLineStart && sc.ch == '#' && options.cpp + && (!options.stylingWithinPreprocessor || sc.state == SCE_HA_DEFAULT)) { sc.SetState(SCE_HA_PREPROCESSOR); sc.Forward(); } @@ -960,7 +961,6 @@ void SCI_METHOD LexerHaskell::Lex(unsigned int startPos, int length, int initSty sc.Forward(); } } - styler.SetLineState(lineCurrent, hs.ToLineState()); sc.Complete(); } -- cgit v1.2.3