mirror of
https://github.com/powerline/powerline.git
synced 2025-07-05 04:54:53 +02:00
Fix common cwd segment for absolute paths
This commit is contained in:
parent
c5df2fcb7c
commit
35de8a192b
@ -83,7 +83,11 @@ def cwd(dir_shorten_len=None, dir_limit_depth=None):
|
|||||||
cwd_split.insert(0, u'⋯')
|
cwd_split.insert(0, u'⋯')
|
||||||
cwd = [i[0:dir_shorten_len] if dir_shorten_len and i else i for i in cwd_split[:-1]] + [cwd_split[-1]]
|
cwd = [i[0:dir_shorten_len] if dir_shorten_len and i else i for i in cwd_split[:-1]] + [cwd_split[-1]]
|
||||||
ret = []
|
ret = []
|
||||||
|
if not cwd[0]:
|
||||||
|
cwd[0] = '/'
|
||||||
for part in cwd:
|
for part in cwd:
|
||||||
|
if not part:
|
||||||
|
continue
|
||||||
ret.append({
|
ret.append({
|
||||||
'contents': part,
|
'contents': part,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user