@@ -65,7 +65,7 @@ def search_completions(self, needle, project_folder, valid_extensions, base_path
6565 for i in needle :
6666 regex += i + ".*"
6767
68- verbose (ID , "scan" , len (project_files ), "files for" , needle , valid_extensions );
68+ verbose (ID , "scan" , len (project_files ), "files for" , regex , valid_extensions );
6969
7070 # get matching files
7171 result = []
@@ -80,9 +80,14 @@ def search_completions(self, needle, project_folder, valid_extensions, base_path
8080 funny: the regex matched here is also matched again by Sublime itself. thus returning all
8181 filepaths is as good as filtering them before, with the exception that the first one is incredibly
8282 faster...
83+
84+ The problem with the second solution is, that sublime does not include anything outside word separators
85+ and thus proposing many invalid paths. Thus the regex has to be faster, by either
86+ - omitting anything after the last slash, since sublime does the rest correctly (no improvement)
87+ - splitting the search by folders...
8388 """
84- # if ((properties[1] in valid_extensions or "*" in valid_extensions) ) and re.match(regex, filepath, re.IGNORECASE)):
85- if ((properties [1 ] in valid_extensions or "*" in valid_extensions )):
89+ if ((properties [1 ] in valid_extensions or "*" in valid_extensions ) and re .match (regex , filepath , re .IGNORECASE )):
90+ # if ((properties[1] in valid_extensions or "*" in valid_extensions)):
8691 completion = self .get_completion (filepath , base_path )
8792 result .append (completion )
8893
0 commit comments