Don't show '//' when using path separator

Currently, the cwd segment is showing //etc when we are in /etc and / when we are in the root file.
This small patch fix this
This commit is contained in:
Glandos 2013-12-01 12:11:53 +01:00
parent db80fc95ed
commit fb7eec2985

View File

@ -115,7 +115,7 @@ def cwd(pl, segment_info, dir_shorten_len=None, dir_limit_depth=None, use_path_s
for part in cwd: for part in cwd:
if not part: if not part:
continue continue
if use_path_separator: if use_path_separator and not part == os.sep:
part += os.sep part += os.sep
ret.append({ ret.append({
'contents': part, 'contents': part,
@ -123,7 +123,7 @@ def cwd(pl, segment_info, dir_shorten_len=None, dir_limit_depth=None, use_path_s
'draw_inner_divider': draw_inner_divider, 'draw_inner_divider': draw_inner_divider,
}) })
ret[-1]['highlight_group'] = ['cwd:current_folder', 'cwd'] ret[-1]['highlight_group'] = ['cwd:current_folder', 'cwd']
if use_path_separator: if use_path_separator and len(ret) > 1:
ret[-1]['contents'] = ret[-1]['contents'][:-1] ret[-1]['contents'] = ret[-1]['contents'][:-1]
return ret return ret