Fix filename issues in vim example
This commit is contained in:
parent
1d1021992f
commit
572df1ded0
|
@ -49,13 +49,13 @@ def statusline():
|
||||||
|
|
||||||
col_current = vim.bindeval('col(".")')
|
col_current = vim.bindeval('col(".")')
|
||||||
|
|
||||||
filepath = os.path.split(vim.bindeval('expand("%:~:.")'))
|
filepath, filename = os.path.split(vim.bindeval('expand("%:~:.")'))
|
||||||
filename_color = 231
|
filename_color = 231
|
||||||
if filepath[0]:
|
if filepath:
|
||||||
filepath[0] += os.sep
|
filepath += os.sep
|
||||||
|
|
||||||
if not filepath[1]:
|
if not filename:
|
||||||
filepath = ('', '[No Name]')
|
filename = '[No Name]'
|
||||||
filename_color = 250
|
filename_color = 250
|
||||||
|
|
||||||
readonly = vim.bindeval('&ro ? "⭤ " : ""')
|
readonly = vim.bindeval('&ro ? "⭤ " : ""')
|
||||||
|
@ -73,8 +73,8 @@ def statusline():
|
||||||
Segment(vim.bindeval('&paste ? "PASTE" : ""'), 231, 166, attr=Segment.ATTR_BOLD),
|
Segment(vim.bindeval('&paste ? "PASTE" : ""'), 231, 166, attr=Segment.ATTR_BOLD),
|
||||||
Segment(branch, 250, 240, priority=10),
|
Segment(branch, 250, 240, priority=10),
|
||||||
Segment(readonly, 196, 240, draw_divider=False),
|
Segment(readonly, 196, 240, draw_divider=False),
|
||||||
Segment(filepath[0], 250, 240, draw_divider=False, priority=5),
|
Segment(filepath, 250, 240, draw_divider=False, priority=5),
|
||||||
Segment(filepath[1], filename_color, 240, attr=Segment.ATTR_BOLD, draw_divider=not len(modified)),
|
Segment(filename, filename_color, 240, attr=Segment.ATTR_BOLD, draw_divider=not len(modified)),
|
||||||
Segment(modified, 220, 240, attr=Segment.ATTR_BOLD),
|
Segment(modified, 220, 240, attr=Segment.ATTR_BOLD),
|
||||||
Segment(currenttag, 246, 236, draw_divider=False, priority=100),
|
Segment(currenttag, 246, 236, draw_divider=False, priority=100),
|
||||||
Segment(filler=True, fg=236, bg=236),
|
Segment(filler=True, fg=236, bg=236),
|
||||||
|
|
|
@ -15,7 +15,7 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! DynStl()
|
function! DynStl()
|
||||||
return s:pyeval('statusline()')
|
return s:pyeval('statusline()')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
set stl=%!DynStl()
|
set stl=%!DynStl()
|
||||||
|
|
Loading…
Reference in New Issue