mirror of
https://github.com/processing/processing4.git
synced 2026-02-13 18:35:37 +01:00
Merge pull request #2690 from AmnonOwed/Fix2004-IndentBreaksOnEnterBeforeSpaces
Fix #2004 - Indent breaks when hitting enter before spaces
This commit is contained in:
@@ -304,9 +304,11 @@ public class PdeKeyListener {
|
||||
//textarea.setSelectionStart(origIndex + 1);
|
||||
textarea.setSelectionEnd(textarea.getSelectionStop() - spaceCount);
|
||||
textarea.setSelectedText("\n");
|
||||
textarea.setCaretPosition(textarea.getCaretPosition() + extraCount + spaceCount);
|
||||
} else {
|
||||
String insertion = "\n" + spaces(spaceCount);
|
||||
textarea.setSelectedText(insertion);
|
||||
textarea.setCaretPosition(textarea.getCaretPosition() + extraCount);
|
||||
}
|
||||
|
||||
// not gonna bother handling more than one brace
|
||||
|
||||
Reference in New Issue
Block a user