fixed bug when getting last action from data file

This commit is contained in:
Alan Hamlett 2013-07-10 01:11:50 -07:00
parent 955e078e2f
commit 2053280349
1 changed files with 2 additions and 2 deletions

View File

@ -99,8 +99,8 @@ let s:VERSION = '0.2.1'
if !filereadable(expand("$HOME/.wakatime.data"))
return [0.0, '', 0.0]
endif
let last = readfile(expand("$HOME/.wakatime.data"), '', 2)
if len(last) < 3
let last = readfile(expand("$HOME/.wakatime.data"), '', 3)
if len(last) != 3
return [0.0, '', 0.0]
endif
return [str2float(last[0]), str2float(last[1]), last[2]]