File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
External/Plugins/ASCompletion/Completion Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1008,13 +1008,16 @@ static private void HandleStructureCompletion(ScintillaControl Sci)
1008
1008
int line = Sci . LineFromPosition ( position ) ;
1009
1009
if ( line == 0 )
1010
1010
return ;
1011
- string txt = Sci . GetLine ( line - 1 ) . TrimEnd ( ) ;
1011
+ string txt = Sci . GetLine ( line - 1 ) . TrimEnd ( ) ;
1012
1012
int style = Sci . BaseStyleAt ( position ) ;
1013
1013
1014
+ // move closing brace to its own line and fix indentation
1014
1015
if ( Sci . CurrentChar == '}' )
1015
1016
{
1016
- Sci . DeleteForward ( ) ;
1017
- AutoCloseBrace ( Sci , line ) ;
1017
+ var openingBrace = Sci . SafeBraceMatch ( position ) ;
1018
+ var openLine = openingBrace >= 0 ? Sci . LineFromPosition ( openingBrace ) : line - 1 ;
1019
+ Sci . InsertText ( Sci . CurrentPos , LineEndDetector . GetNewLineMarker ( Sci . EOLMode ) ) ;
1020
+ Sci . SetLineIndentation ( line + 1 , Sci . GetLineIndentation ( openLine ) ) ;
1018
1021
}
1019
1022
// in comments
1020
1023
else if ( PluginBase . Settings . CommentBlockStyle == CommentBlockStyle . Indented && txt . EndsWith ( "*/" ) )
You can’t perform that action at this time.
0 commit comments