##// END OF EJS Templates
Fixed variable names and path delimiter for #11441
Elliott Morgan Jobson -
Show More
@@ -19,6 +19,7 b' from prompt_toolkit.lexers import PygmentsLexer'
19 19 from prompt_toolkit.patch_stdout import patch_stdout
20 20
21 21 import pygments.lexers as pygments_lexers
22 import os
22 23
23 24 _completion_sentinel = object()
24 25
@@ -40,13 +41,13 b' def _elide(string, *, min_elide=30):'
40 41 return string
41 42
42 43 object_parts = string.split('.')
43 file_parts = string.split('/')
44 file_parts = string.split(os.sep)
44 45
45 46 if len(object_parts) > 3:
46 return '{}.{}\N{HORIZONTAL ELLIPSIS}{}.{}'.format(parts[0], parts[1][0], parts[-2][-1], parts[-1])
47 return '{}.{}\N{HORIZONTAL ELLIPSIS}{}.{}'.format(object_parts[0], object_parts[1][0], object_parts[-2][-1], object_parts[-1])
47 48
48 49 elif len(file_parts) > 3:
49 return '{}/{}\N{HORIZONTAL ELLIPSIS}{}/{}'.format(parts[0], parts[1][0], parts[-2][-1], parts[-1])
50 return '{}/{}\N{HORIZONTAL ELLIPSIS}{}/{}'.format(file_parts[0], file_parts[1][0], file_parts[-2][-1], file_parts[-1])
50 51
51 52 return string
52 53
General Comments 0
You need to be logged in to leave comments. Login now