Fix filepath caching when cwd changes (Fix #179) #189

Closed
wants to merge 2 commits into
from

Projects

None yet

2 participants

@idbrii

Fixes #179: Update the filepath when the cwd changes

Issue #179 occurred because powerline never recalculated the cached filepath (but 'relative' requires it to be recalculated when the cwd changes). Sometimes, you'd see the filepath change when switching from cwd to another dir because the filepath wasn't cached when the file is in the cwd.

This pull clears the cached filepath when cwd changes (so it will be recalculated) and caches the filepath when the file is in the cwd. (So we're only recalculating when something actually changes.)

idbrii added some commits Aug 4, 2012
@idbrii idbrii Cache the current filepath when cwd == .
When editing a file in the current working directory, cache the filepath
just like when outside the cwd. (If b:Powerline_filepath isn't set, the
filepath isn't cached and vim recalculate everytime it draws the
statusline.)

Still doesn't cache when the filepath is empty.
0259703
@idbrii idbrii 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.
f2ed221
@Lokaltog Lokaltog added a commit that referenced this pull request Aug 7, 2012
@idbrii idbrii Cache the current filepath when cwd == .
When editing a file in the current working directory, cache the filepath
just like when outside the cwd. (If b:Powerline_filepath isn't set, the
filepath isn't cached and vim recalculate everytime it draws the
statusline.)

Still doesn't cache when the filepath is empty.

Refs #179.
Refs #189.
f929a34
@Lokaltog Lokaltog added a commit that referenced this pull request Aug 7, 2012
@idbrii idbrii 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.
ac420bb
@Lokaltog Lokaltog closed this Aug 7, 2012
@neersighted neersighted added a commit that referenced this pull request Aug 13, 2012
@idbrii idbrii Cache the current filepath when cwd == .
When editing a file in the current working directory, cache the filepath
just like when outside the cwd. (If b:Powerline_filepath isn't set, the
filepath isn't cached and vim recalculate everytime it draws the
statusline.)

Still doesn't cache when the filepath is empty.

Refs #179.
Refs #189.
ad73598
@neersighted neersighted added a commit that referenced this pull request Aug 13, 2012
@idbrii idbrii 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.
cef3b44
@idbrii idbrii deleted the idbrii:fix-179-relative branch Jan 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment