Fix display for home directory

This commit is contained in:
Glandos 2013-12-01 12:35:12 +01:00
parent fb7eec2985
commit c97bc8249f
1 changed files with 4 additions and 2 deletions

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 and not part == os.sep: if use_path_separator:
part += os.sep part += os.sep
ret.append({ ret.append({
'contents': part, 'contents': part,
@ -123,8 +123,10 @@ 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 and len(ret) > 1: if use_path_separator:
ret[-1]['contents'] = ret[-1]['contents'][:-1] ret[-1]['contents'] = ret[-1]['contents'][:-1]
if len(ret) > 1 and ret[0]['contents'][0] == os.sep:
ret[0]['contents'] = ret[0]['contents'][1:]
return ret return ret