소스 검색

Console case insensitive completion

Leonardo Jeanteur 3 년 전
부모
커밋
f78df94931
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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;
 				}