mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-06 17:30:59 +01:00
implement ellipsis and add some comments
This commit is contained in:
parent
b4157321a6
commit
eec7c0992d
1 changed files with 7 additions and 1 deletions
|
@ -1041,8 +1041,14 @@ def _dynamically_collapsed_pwd():
|
|||
|
||||
parts.append(last)
|
||||
full = sep.join(parts)
|
||||
# If even if displaying one letter per dir we are too long
|
||||
if (len(full) > target_width):
|
||||
full = full[int(-target_width):]
|
||||
# We truncate the left most part
|
||||
full = "..." + full[int(-target_width) + 3:]
|
||||
# if there is not even a single separator we still
|
||||
# want to display at least the beginning of the directory
|
||||
if full.find(sep) == -1:
|
||||
full = ("..." + sep + last)[0:int(target_width)]
|
||||
return full
|
||||
|
||||
def _current_job():
|
||||
|
|
Loading…
Add table
Reference in a new issue