Fixed syntax highlighting issue

git-svn-id: svn://ultimatepp.org/upp/trunk@505 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2008-10-03 09:03:43 +00:00
parent 6cf84f10b8
commit 87941376aa
2 changed files with 3 additions and 2 deletions

View file

@ -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<LineEdit::Highlight>& 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;

View file

@ -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();