File tree Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Expand file tree Collapse file tree 1 file changed +2
-21
lines changed Original file line number Diff line number Diff line change 45
45
import processing .app .syntax .ArduinoTokenMakerFactory ;
46
46
import processing .app .syntax .PdeKeywords ;
47
47
import processing .app .syntax .SketchTextArea ;
48
+ import processing .app .syntax .SketchTextAreaEditorKit ;
48
49
import processing .app .tools .DiscourseFormat ;
49
50
import processing .app .tools .MenuScroller ;
50
51
import processing .app .tools .Tool ;
@@ -1872,28 +1873,8 @@ void handleCommentUncomment() {
1872
1873
1873
1874
private void handleIndentOutdent (boolean indent ) {
1874
1875
if (indent ) {
1875
-
1876
- int caretPosition = textarea .getCaretPosition ();
1877
- boolean noSelec = !textarea .isSelectionActive ();
1878
-
1879
- // if no selection, focus on first char.
1880
- if (noSelec ) {
1881
- try {
1882
- int line = textarea .getCaretLineNumber ();
1883
- int startOffset = textarea .getLineStartOffset (line );
1884
- textarea .setCaretPosition (startOffset );
1885
- } catch (BadLocationException e ) {
1886
- }
1887
- }
1888
-
1889
- // Insert Tab or Spaces..
1890
- Action action = textarea .getActionMap ().get (RSyntaxTextAreaEditorKit .insertTabAction );
1876
+ Action action = textarea .getActionMap ().get (SketchTextAreaEditorKit .rtaIncreaseIndentAction );
1891
1877
action .actionPerformed (null );
1892
-
1893
- if (noSelec ) {
1894
- textarea .setCaretPosition (caretPosition );
1895
- }
1896
-
1897
1878
} else {
1898
1879
Action action = textarea .getActionMap ().get (RSyntaxTextAreaEditorKit .rstaDecreaseIndentAction );
1899
1880
action .actionPerformed (null );
You can’t perform that action at this time.
0 commit comments