@@ -260,7 +260,7 @@ static public bool OnShortcut(Keys keys, ScintillaControl Sci)
260260 }
261261 else if ( keys == Keys . Back )
262262 {
263- HandleAddClosingBraces ( Sci , ( char ) Sci . CharAt ( Sci . CurrentPos ) , false ) ;
263+ HandleAddClosingBraces ( Sci , Sci . CurrentChar , false ) ;
264264 return false ;
265265 }
266266 // show calltip
@@ -437,10 +437,9 @@ private static void HandleAddBrace(ScintillaControl sci, char c, Braces braces)
437437 else if ( c == braces . closing )
438438 {
439439 // already a closing brace?
440- if ( ( char ) sci . CharAt ( sci . CurrentPos ) == braces . closing )
440+ if ( sci . CurrentChar == braces . closing )
441441 {
442- sci . SetSel ( sci . CurrentPos + 1 , sci . CurrentPos + 1 ) ;
443- sci . DeleteBack ( ) ;
442+ sci . DeleteForward ( ) ;
444443 }
445444 }
446445 }
@@ -452,8 +451,7 @@ private static void HandleRemoveBrace(ScintillaControl sci, char c, Braces brace
452451 {
453452 if ( ( char ) sci . CharAt ( sci . CurrentPos - 1 ) == braces . opening )
454453 {
455- sci . SetSel ( sci . CurrentPos + 1 , sci . CurrentPos + 1 ) ;
456- sci . DeleteBack ( ) ;
454+ sci . DeleteForward ( ) ;
457455 }
458456 }
459457 }
@@ -1011,8 +1009,13 @@ static private void HandleStructureCompletion(ScintillaControl Sci)
10111009 string txt = Sci . GetLine ( line - 1 ) . TrimEnd ( ) ;
10121010 int style = Sci . BaseStyleAt ( position ) ;
10131011
1014- // in comments
1015- if ( PluginBase . Settings . CommentBlockStyle == CommentBlockStyle . Indented && txt . EndsWith ( "*/" ) )
1012+ if ( Sci . CurrentChar == '}' )
1013+ {
1014+ Sci . DeleteForward ( ) ;
1015+ AutoCloseBrace ( Sci , line ) ;
1016+ }
1017+ // in comments
1018+ else if ( PluginBase . Settings . CommentBlockStyle == CommentBlockStyle . Indented && txt . EndsWith ( "*/" ) )
10161019 FixIndentationAfterComments ( Sci , line ) ;
10171020 else if ( IsCommentStyle ( style ) && ( Sci . BaseStyleAt ( position + 1 ) == style ) )
10181021 FormatComments ( Sci , txt , line ) ;
0 commit comments