Browse Source

sort files/dirs by name

Nicolas Cannasse 4 years ago
parent
commit
48a7c1212f
1 changed files with 3 additions and 1 deletions
  1. 3 1
      hide/comp/cdb/DataFiles.hx

+ 3 - 1
hide/comp/cdb/DataFiles.hx

@@ -117,7 +117,9 @@ class DataFiles {
 					ide.fileWatcher.register(path, onFileChanged, true);
 					ide.fileWatcher.register(path, onFileChanged, true);
 				}
 				}
 				var reg = new EReg("^"+part.split(".").join("\\.").split("*").join(".*")+"$","");
 				var reg = new EReg("^"+part.split(".").join("\\.").split("*").join(".*")+"$","");
-				for( f in sys.FileSystem.readDirectory(dir) ) {
+				var subs = sys.FileSystem.readDirectory(dir);
+				subs.sort(Reflect.compare);
+				for( f in subs ) {
 					if( !reg.match(f) ) {
 					if( !reg.match(f) ) {
 						if( sys.FileSystem.isDirectory(dir+"/"+f) ) {
 						if( sys.FileSystem.isDirectory(dir+"/"+f) ) {
 							curPath.push(f);
 							curPath.push(f);