Skip to content

Commit 3a3b695

Browse files
committed
Only reload tabs if not in modified state
1 parent 25b55d9 commit 3a3b695

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ public void windowActivated(WindowEvent e) {
242242
watcher = null;
243243
}
244244
base.handleActivated(Editor.this);
245-
getTabs().forEach(tab -> tab.reload());
246245
}
247246

248247
// added for 1.0.5

Diff for: app/src/processing/app/tools/WatchDir.java

+9-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ public void processEvents(Editor editor) {
151151
SketchFile sketch = editor.getSketch().addFile(filename);
152152
editor.addTab(sketch, null);
153153
}
154-
} catch (IOException e) {}
154+
} catch (Exception e) {
155+
return;
156+
}
155157
} else if (kind == ENTRY_DELETE) {
156158
try {
157159
Thread.sleep(100);
@@ -160,9 +162,14 @@ public void processEvents(Editor editor) {
160162
} catch (Exception e1) {
161163
// Totally fine, if the sleep gets interrupted it means that
162164
// the action was executed in the UI, not externally
165+
return;
163166
}
164167
}
165-
168+
editor.getTabs().forEach(tab -> {
169+
if (!tab.isModified()) {
170+
tab.reload();
171+
}
172+
});
166173
// if directory is created, and watching recursively, then
167174
// register it and its sub-directories
168175
if (recursive && (kind == ENTRY_CREATE)) {

0 commit comments

Comments
 (0)