Skip to content

Commit d304c45

Browse files
author
Federico Fissore
committed
Clearing state of editor.status when hitting one of new/rename/delete context menu entries. Fixes #3720
1 parent fa78f71 commit d304c45

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/src/processing/app/EditorStatus.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ public EditorStatus(Editor editor) {
9393
initialize();
9494
}
9595

96-
private void clearState() {
96+
public void clearState() {
9797
changeState(NOTICE);
98+
repaint();
9899
}
99100

100101
private void changeState(int newMode) {

app/src/processing/app/Sketch.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ protected void load(boolean forceUpdate) throws IOException {
131131
* Handler for the New Code menu option.
132132
*/
133133
public void handleNewCode() {
134+
editor.status.clearState();
134135
// make sure the user didn't hide the sketch folder
135136
ensureExistence();
136137

@@ -153,6 +154,7 @@ public void handleNewCode() {
153154
* Handler for the Rename Code menu option.
154155
*/
155156
public void handleRenameCode() {
157+
editor.status.clearState();
156158
// make sure the user didn't hide the sketch folder
157159
ensureExistence();
158160

@@ -430,6 +432,7 @@ protected void nameCode(String newName) {
430432
* Remove a piece of code from the sketch and from the disk.
431433
*/
432434
public void handleDeleteCode() {
435+
editor.status.clearState();
433436
// make sure the user didn't hide the sketch folder
434437
ensureExistence();
435438

@@ -1223,8 +1226,6 @@ private void ensureExistence() {
12231226
* Returns true if this is a read-only sketch. Used for the
12241227
* examples directory, or when sketches are loaded from read-only
12251228
* volumes or folders without appropriate permissions.
1226-
* @param librariesPaths
1227-
* @param examplesPath
12281229
*/
12291230
public boolean isReadOnly(LibraryList libraries, String examplesPath) {
12301231
String apath = data.getFolder().getAbsolutePath();

0 commit comments

Comments
 (0)