diff --git a/uppsrc/CodeEditor/Highlight.cpp b/uppsrc/CodeEditor/Highlight.cpp index 2efda9579..c546b96db 100644 --- a/uppsrc/CodeEditor/Highlight.cpp +++ b/uppsrc/CodeEditor/Highlight.cpp @@ -206,6 +206,7 @@ const wchar *CodeEditor::HlString(HlSt& hls, const wchar *p) Color CodeEditor::BlockColor(int level) { + DDUMP(level); if(hilite_scope == 1) return GetHlStyle(level & 1 ? PAPER_BLOCK1 : PAPER_NORMAL).color; if(hilite_scope == 2) { @@ -501,7 +502,7 @@ void CodeEditor::HighlightLine(int line, Vector& hl, int po } else if(*p == ')' || *p == '}' || *p == ']') { - if(*p == '}' && hilite_scope) + if(*p == '}' && hilite_scope && block_level > 0) hls.SetPaper(hls.pos, text.GetLength() + 1 - hls.pos, BlockColor(--block_level)); Bracket(int(p - text) + pos, hls); int& l = *p == ')' ? ss.pl : *p == '}' ? ss.cl : ss.bl; diff --git a/uppsrc/CodeEditor/Syntax.cpp b/uppsrc/CodeEditor/Syntax.cpp index 124669c5f..ffd217998 100644 --- a/uppsrc/CodeEditor/Syntax.cpp +++ b/uppsrc/CodeEditor/Syntax.cpp @@ -276,7 +276,7 @@ void CodeEditor::SyntaxState::ScanSyntax(const wchar *ln, const wchar *e) } if(blk.GetCount()) blk.Drop(); - if(bid.GetCount()) + if(bid.GetCount() > 1) bid.Drop(); stmtline = -1; par.Clear();