From: Leon W. <moo...@us...> - 2005-11-13 10:53:28
|
Update of /cvsroot/anyedit/AnyEditv2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18159 Modified Files: ScintillaEx.cpp Log Message: Improved AutoIndent to work with the Smart Tag feature. Index: ScintillaEx.cpp =================================================================== RCS file: /cvsroot/anyedit/AnyEditv2/ScintillaEx.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ScintillaEx.cpp 7 Nov 2005 19:36:15 -0000 1.31 --- ScintillaEx.cpp 13 Nov 2005 10:53:16 -0000 1.32 *************** *** 1171,1179 **** if( GetEOLMode() == SC_EOL_CRLF ) --pos; // Do we have a '{', ')', ':' or '>' if( GetCharAt( pos ) == '{' || GetCharAt( pos ) == ')' || GetCharAt( pos ) == ':' || ! ( GetCharAt( pos - 1 ) != '/' && GetCharAt( pos ) == '>' ) ) { int count = 1; --- 1171,1190 ---- if( GetEOLMode() == SC_EOL_CRLF ) --pos; + // If we have a tag we want to know where it starts. + long tagStartPos = 0; + if( GetCharAt( pos ) == '>' ) + { + tagStartPos = pos - 1; + while( tagStartPos >= 0 ) + { + if( '<' == GetCharAt( tagStartPos ) ) break; + -- tagStartPos; + } + } // Do we have a '{', ')', ':' or '>' if( GetCharAt( pos ) == '{' || GetCharAt( pos ) == ')' || GetCharAt( pos ) == ':' || ! ( GetCharAt( tagStartPos + 1 ) != '/' && GetCharAt( pos - 1 ) != '/' && GetCharAt( pos - 1 ) != '?' && GetCharAt( pos ) == '>' ) ) { int count = 1; *************** *** 1279,1282 **** --- 1290,1294 ---- SetSel(lPos,lCurrentPos); CString text = GetSelText(); + if( text == "<>" ) break; int pos = text.Find(' '); if( -1 == pos ) |