Permalink
Browse files

Update the filepath when the cwd changes

The g:Powerline_stl_path_style == 'relative' option requires the
filepath to be updated everytime the cwd changes.

Store the cwd and if the stored value's different from the current,
clear the cached filepath.

Closes #179.
Refs #189.
  • Loading branch information...
1 parent f929a34 commit ac420bb1248653cfa10d9b1ebd085a6488521e90 pydave committed with Aug 4, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 autoload/Powerline/Functions.vim
@@ -2,6 +2,13 @@
autocmd CursorHold,BufWritePost,InsertLeave * unlet! b:statusline_trailing_space_warning
function! Powerline#Functions#GetFilepath() " {{{
+ " Recalculate the filepath when cwd changes.
+ let cwd = getcwd()
+ if exists("b:Powerline_cwd") && cwd != b:Powerline_cwd
+ unlet! b:Powerline_filepath
+ endif
+ let b:Powerline_cwd = cwd
+
if exists('b:Powerline_filepath')
return b:Powerline_filepath
endif

0 comments on commit ac420bb

Please sign in to comment.