Browse Source

Console case insensitive completion

Leonardo Jeanteur 3 years ago
parent
commit
f78df94931
1 changed files with 2 additions and 1 deletions
  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;
 				}