File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 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:
343343 return after_last_dot (word )
344344
345345
346+ def _safe_glob (pathname : str ) -> Iterator [str ]:
347+ return glob .iglob (glob .escape (pathname ) + "*" )
348+
349+
346350class FilenameCompletion (BaseCompletionType ):
347351 def __init__ (self , mode : AutocompleteModes = AutocompleteModes .SIMPLE ):
348352 super ().__init__ (False , mode )
349353
350- def safe_glob (self , pathname : str ) -> Iterator [str ]:
351- return glob .iglob (glob .escape (pathname ) + "*" )
352-
353354 def matches (
354355 self , cursor_offset : int , line : str , ** kwargs : Any
355356 ) -> Optional [Set ]:
@@ -359,7 +360,7 @@ def matches(
359360 matches = set ()
360361 username = cs .word .split (os .path .sep , 1 )[0 ]
361362 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 )):
363364 if os .path .isdir (filename ):
364365 filename += os .path .sep
365366 if cs .word .startswith ("~" ):
You can’t perform that action at this time.
0 commit comments