From 572df1ded022dd03bbbc4e12423aadd16bbd776d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Silkeb=C3=A6kken?= Date: Fri, 16 Nov 2012 17:16:30 +0100 Subject: [PATCH] Fix filename issues in vim example --- examples/vim/powerline.py | 14 +++++++------- examples/vim/powerline.vim | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/vim/powerline.py b/examples/vim/powerline.py index 11066d86..d267a5ef 100644 --- a/examples/vim/powerline.py +++ b/examples/vim/powerline.py @@ -49,13 +49,13 @@ def statusline(): col_current = vim.bindeval('col(".")') - filepath = os.path.split(vim.bindeval('expand("%:~:.")')) + filepath, filename = os.path.split(vim.bindeval('expand("%:~:.")')) filename_color = 231 - if filepath[0]: - filepath[0] += os.sep + if filepath: + filepath += os.sep - if not filepath[1]: - filepath = ('', '[No Name]') + if not filename: + filename = '[No Name]' filename_color = 250 readonly = vim.bindeval('&ro ? "тнд " : ""') @@ -73,8 +73,8 @@ def statusline(): Segment(vim.bindeval('&paste ? "PASTE" : ""'), 231, 166, attr=Segment.ATTR_BOLD), Segment(branch, 250, 240, priority=10), Segment(readonly, 196, 240, draw_divider=False), - Segment(filepath[0], 250, 240, draw_divider=False, priority=5), - Segment(filepath[1], filename_color, 240, attr=Segment.ATTR_BOLD, draw_divider=not len(modified)), + Segment(filepath, 250, 240, draw_divider=False, priority=5), + Segment(filename, filename_color, 240, attr=Segment.ATTR_BOLD, draw_divider=not len(modified)), Segment(modified, 220, 240, attr=Segment.ATTR_BOLD), Segment(currenttag, 246, 236, draw_divider=False, priority=100), Segment(filler=True, fg=236, bg=236), diff --git a/examples/vim/powerline.vim b/examples/vim/powerline.vim index 469c3b32..d3b86b12 100644 --- a/examples/vim/powerline.vim +++ b/examples/vim/powerline.vim @@ -15,7 +15,7 @@ else endif function! DynStl() - return s:pyeval('statusline()') + return s:pyeval('statusline()') endfunction set stl=%!DynStl()