File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -343,13 +343,14 @@ def format(self, word: str) -> str:
343
343
return after_last_dot (word )
344
344
345
345
346
+ def _safe_glob (pathname : str ) -> Iterator [str ]:
347
+ return glob .iglob (glob .escape (pathname ) + "*" )
348
+
349
+
346
350
class FilenameCompletion (BaseCompletionType ):
347
351
def __init__ (self , mode : AutocompleteModes = AutocompleteModes .SIMPLE ):
348
352
super ().__init__ (False , mode )
349
353
350
- def safe_glob (self , pathname : str ) -> Iterator [str ]:
351
- return glob .iglob (glob .escape (pathname ) + "*" )
352
-
353
354
def matches (
354
355
self , cursor_offset : int , line : str , ** kwargs : Any
355
356
) -> Optional [Set ]:
@@ -359,7 +360,7 @@ def matches(
359
360
matches = set ()
360
361
username = cs .word .split (os .path .sep , 1 )[0 ]
361
362
user_dir = os .path .expanduser (username )
362
- for filename in self . safe_glob (os .path .expanduser (cs .word )):
363
+ for filename in _safe_glob (os .path .expanduser (cs .word )):
363
364
if os .path .isdir (filename ):
364
365
filename += os .path .sep
365
366
if cs .word .startswith ("~" ):
You can’t perform that action at this time.
0 commit comments