Skip to content

Commit c6f6c12

Browse files
committed
Ensure files are opened in the right order
1 parent b3b5443 commit c6f6c12

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

BAR/src/main/java/bar/plugin/Tutorials.java

+10
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.nio.file.Paths;
2323
import java.util.ArrayList;
2424
import java.util.Collections;
25+
import java.util.Comparator;
2526
import java.util.Iterator;
2627
import java.util.stream.Stream;
2728

@@ -59,6 +60,15 @@ public void run() {
5960
uiService.showDialog("Could not load tutorial files.", DialogPrompt.MessageType.ERROR_MESSAGE);
6061
return;
6162
}
63+
64+
// Ensure files are opened in the right order
65+
urls.sort(new Comparator<URL>() {
66+
@Override
67+
public int compare(final URL u1, final URL u2) {
68+
return u1.toString().compareTo(u2.toString());
69+
}
70+
71+
});
6272
final TextEditor editor = new TextEditor(context);
6373
for (final URL url : urls) {
6474
statusService.showStatus(urls.indexOf(url), urls.size(), "Opening tutorial files...");

0 commit comments

Comments
 (0)