Skip to content

Commit fcd88e6

Browse files
committed
IDE: "New/rename tab" now allow numbers as first char
Fix #6656 Related to #6592 and 4545283
1 parent 5bbb905 commit fcd88e6

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

Diff for: app/src/processing/app/EditorStatus.java

+2-11
Original file line numberDiff line numberDiff line change
@@ -316,21 +316,12 @@ public void keyTyped(KeyEvent event) {
316316
editField.setCaretPosition(start + 1);
317317
event.consume();
318318

319-
320319
} else if ((c == '_') || (c == '.') || ((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z'))) { // allow .pde and .java
321320
// these are ok, allow them through
322321

323322
} else if ((c >= '0') && (c <= '9')) {
324-
// getCaretPosition == 0 means that it's the first char
325-
// and the field is empty.
326-
// getSelectionStart means that it *will be* the first
327-
// char, because the selection is about to be replaced
328-
// with whatever is typed.
329-
if ((editField.getCaretPosition() == 0) ||
330-
(editField.getSelectionStart() == 0)) {
331-
// number not allowed as first digit
332-
event.consume();
333-
}
323+
// these are ok, allow them through
324+
334325
} else {
335326
event.consume();
336327
}

0 commit comments

Comments
 (0)