From 88eeb5bd26cfe82e1ee9357963cff11803bee2dd Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 15 Feb 2015 16:21:54 +0000 Subject: [PATCH] CodeEditor: Fixed block highlighting issue #983 git-svn-id: svn://ultimatepp.org/upp/trunk@8181 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CodeEditor/CLogic.cpp | 6 ++++++ uppsrc/CodeEditor/CodeEditor.cpp | 4 ++-- uppsrc/ide/idewin.cpp | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/uppsrc/CodeEditor/CLogic.cpp b/uppsrc/CodeEditor/CLogic.cpp index dc46c6687..f6bbc400c 100644 --- a/uppsrc/CodeEditor/CLogic.cpp +++ b/uppsrc/CodeEditor/CLogic.cpp @@ -197,6 +197,12 @@ void CSyntax::CheckSyntaxRefresh(CodeEditor& e, int pos, const WString& text) String s = TrimLeft(e.GetUtf8Line(e.GetLine(pos))); if(s.StartsWith("#if") || s.StartsWith("#e")) e.Refresh(); + + WString h = e.GetWLine(e.GetLinePos(pos)); // block highlighting changes if start of line is changed + for(int i = 0; i < pos; i++) + if(findarg(h[i], ' ', '\t') < 0) + return; + e.Refresh(); } END_UPP_NAMESPACE diff --git a/uppsrc/CodeEditor/CodeEditor.cpp b/uppsrc/CodeEditor/CodeEditor.cpp index da17edf8a..3740cf489 100644 --- a/uppsrc/CodeEditor/CodeEditor.cpp +++ b/uppsrc/CodeEditor/CodeEditor.cpp @@ -75,8 +75,8 @@ inline bool IsComment(int a, int b) { return a == '/' && b == '*' || a == '*' && b == '/' || a == '/' && b == '/'; } -void CodeEditor::PreInsert(int pos, const WString& text) { - if(IsFullRefresh()) return; +void CodeEditor::PreInsert(int pos, const WString& text) +{ } inline bool RBR(int c) { diff --git a/uppsrc/ide/idewin.cpp b/uppsrc/ide/idewin.cpp index 877754116..12e60a1d6 100644 --- a/uppsrc/ide/idewin.cpp +++ b/uppsrc/ide/idewin.cpp @@ -712,7 +712,7 @@ void AppMain___() #endif #ifdef _DEBUG -// Ctrl::ShowRepaint(50); + Ctrl::ShowRepaint(20); _DBG_ #endif #ifdef PLATFORM_WIN32