mirror of
https://github.com/powerline/powerline.git
synced 2025-07-29 16:55:07 +02:00
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:
parent
db80fc95ed
commit
fb7eec2985
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user