Skip to content
Browse files

Fix #179: 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.
  • Loading branch information...
1 parent 0259703 commit f2ed221ebca8da2b9c1ac481757da87bb37a2140 @idbrii committed
Showing with 7 additions and 0 deletions.
  1. +7 −0 autoload/Powerline/Functions.vim
View
7 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 f2ed221

Please sign in to comment.
Something went wrong with that request. Please try again.