##// END OF EJS Templates
Merge pull request #13675 from d3dave/bugfix/elide-point-out-of-range...
Matthias Bussonnier -
r27752:1061a1ec merge
parent child Browse files
Show More
@@ -0,0 +1,5 b''
1 Fixed tab completion for inputs with consecutive separators
2 ===========================================================
3
4 Fixed error raised when attempting to tab-complete an input string with
5 consecutive periods or forward slashes (such as "file:///var/log/...").
@@ -48,10 +48,17 b' def _elide_point(string:str, *, min_elide=30)->str:'
48 file_parts.pop()
48 file_parts.pop()
49
49
50 if len(object_parts) > 3:
50 if len(object_parts) > 3:
51 return '{}.{}\N{HORIZONTAL ELLIPSIS}{}.{}'.format(object_parts[0], object_parts[1][0], object_parts[-2][-1], object_parts[-1])
51 return "{}.{}\N{HORIZONTAL ELLIPSIS}{}.{}".format(
52 object_parts[0],
53 object_parts[1][:1],
54 object_parts[-2][-1:],
55 object_parts[-1],
56 )
52
57
53 elif len(file_parts) > 3:
58 elif len(file_parts) > 3:
54 return ('{}' + os.sep + '{}\N{HORIZONTAL ELLIPSIS}{}' + os.sep + '{}').format(file_parts[0], file_parts[1][0], file_parts[-2][-1], file_parts[-1])
59 return ("{}" + os.sep + "{}\N{HORIZONTAL ELLIPSIS}{}" + os.sep + "{}").format(
60 file_parts[0], file_parts[1][:1], file_parts[-2][-1:], file_parts[-1]
61 )
55
62
56 return string
63 return string
57
64
General Comments 0
You need to be logged in to leave comments. Login now