Fix vim file_directory segment

Closes #117.
Closes #119.
This commit is contained in:
Kim Silkebækken 2013-01-24 12:17:25 +01:00
parent 9282bf61f4
commit 5d5841c1fa
1 changed files with 2 additions and 0 deletions

View File

@ -81,6 +81,8 @@ def readonly_indicator(text=u''):
def file_directory():
'''Return file directory (head component of the file path).'''
file_directory = vim_funcs['expand']('%:~:.:h')
if file_directory is None:
return None
if file_directory.startswith('/home/'):
file_directory = '~' + file_directory[6:]
return file_directory.decode('utf-8') + os.sep if file_directory else None