@@ -31,14 +31,19 @@ def run(self, edit):
3131 path = Path .get_absolute_path (current_directory , path )
3232 path = re .sub (project_folder , "" , path )
3333
34+
3435 path = re .sub ("^[\\ \\ /\.]" , "" , path )
36+ realpath = path
3537 # cleanup string, in case there are special characters for a path
3638 # e.g. webpack uses ~, which is not part of path
3739 path = re .sub ("[^A-Za-z0-9 \-_\\ \\ /.%?#]*" , "" , path )
3840 files = state .find_file (path )
3941
4042 if len (files ) == 0 :
41- return log (ID , "failed finding file" , path )
43+ # it may be an uncached file, try to open it by using the real path
44+ if self .filepath_exists (os .path .join (project_folder , realpath )):
45+ return self .open_file (project_folder , realpath )
46+ return log (ID , "failed finding file" , path , "it is not within the cache and not a realpath" )
4247
4348 if len (files ) == 1 :
4449 self .open_file (project_folder , files [0 ])
@@ -54,6 +59,9 @@ def run(self, edit):
5459 self .project_folder = project_folder
5560 self .view .show_popup_menu (files , self .select_file )
5661
62+ def filepath_exists (self , filepath ):
63+ return os .path .isfile (filepath )
64+
5765 def select_file (self , index ):
5866 self .open_file (self .project_folder , self .files [index ])
5967 self .files = None
0 commit comments