Skip to content
This repository has been archived by the owner on Dec 5, 2018. It is now read-only.

Commit

Permalink
Fix #179: Update the filepath when the cwd changes
Browse files Browse the repository at this point in the history
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
pydave committed Aug 4, 2012
1 parent 0259703 commit f2ed221
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autoload/Powerline/Functions.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f2ed221

Please sign in to comment.