Explorar o código

Console case insensitive completion

Leonardo Jeanteur %!s(int64=3) %!d(string=hai) anos
pai
achega
f78df94931
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      h2d/Console.hx

+ 2 - 1
h2d/Console.hx

@@ -319,11 +319,12 @@ class Console #if !macro extends h2d.Object #end {
 		if (cmd == "") {
 			return "";
 		}
+		var lowCmd = cmd.toLowerCase();
 
 		var closestCommand = "";
 		var commandNames = commands.keys();
 		for (command in commandNames) {
-			if (command.indexOf(cmd) == 0) {
+			if (command.toLowerCase().indexOf(lowCmd) == 0) {
 				if (closestCommand == "" || closestCommand.length > command.length) {
 					closestCommand = command;
 				}