CodeEditor: CSyntax Indent after label or access control

git-svn-id: svn://ultimatepp.org/upp/trunk@11108 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-05-19 06:50:33 +00:00
parent bafafcc6ed
commit e0866b62f4

View file

@ -75,7 +75,8 @@ void CSyntax::IndentInsert0(CodeEditor& e, int chr, int count, bool reformat)
e.InsertChar(*s++, 1);
if(!syntax)
return;
if(syntax->stmtline == cl || syntax->blk.GetCount() && syntax->blk.Top() == cl) {
if(syntax->stmtline == cl || syntax->blk.GetCount() && syntax->blk.Top() == cl // statement (if, while..) || first line of block
|| *pl.Last() == ':') { // label
if(indent_spaces || (s > pl && s[-1] == ' '))
e.InsertChar(' ', indent_amount);
else