@@ -13,10 +13,12 @@ public class SketchTextAreaEditorKit extends RSyntaxTextAreaEditorKit {
1313
1414  public  static  final  String  rtaDeleteNextWordAction  = "RTA.DeleteNextWordAction" ;
1515  public  static  final  String  rtaDeleteLineToCursorAction  = "RTA.DeleteLineToCursorAction" ;
16+   public  static  final  String  rtaIncreaseIndentAction  = "RTA.IncreaseIndentAction" ;
1617
1718  private  static  final  Action [] defaultActions  = {
1819    new  DeleteNextWordAction (),
1920    new  DeleteLineToCursorAction (),
21+     new  IncreaseIndentAction (),
2022    new  SelectWholeLineAction (),
2123    new  ToggleCommentAction ()
2224  };
@@ -103,6 +105,39 @@ public String getMacroID() {
103105
104106  }
105107
108+   /** 
109+    * Increases the indent of the selected or current line(s). 
110+    */ 
111+   public  static  class  IncreaseIndentAction  extends  RSyntaxTextAreaEditorKit .InsertTabAction  {
112+ 
113+     public  IncreaseIndentAction () {
114+       super (rtaIncreaseIndentAction );
115+     }
116+ 
117+     @ Override 
118+     public  void  actionPerformedImpl (ActionEvent  e , RTextArea  textArea ) {
119+       int  caretPosition  = textArea .getCaretPosition ();
120+       boolean  noSelec  = textArea .getSelectedText () == null ;
121+ 
122+       // if no selection, focus on first char. 
123+       if  (noSelec ) {
124+         try  {
125+           int  line  = textArea .getCaretLineNumber ();
126+           int  startOffset  = textArea .getLineStartOffset (line );
127+           textArea .setCaretPosition (startOffset );
128+         } catch  (BadLocationException  ex ) {
129+         }
130+       }
131+ 
132+       // Insert Tab or Spaces.. 
133+       super .actionPerformedImpl (e , textArea );
134+ 
135+       if  (noSelec ) {
136+         textArea .setCaretPosition (caretPosition  + (textArea .getTabsEmulated () ? textArea .getTabSize () : 1 ));
137+       }
138+     }
139+   }
140+ 
106141  /** 
107142   * Selects the line around the caret. 
108143   */ 
0 commit comments