fixed bugs in function s:allServersAway(). preventing action sent when editor first opened without file.

This commit is contained in:
Alan Hamlett 2013-06-25 22:58:13 -07:00
parent 633647ce78
commit e904799d68

View file

@ -88,11 +88,15 @@ function! s:GetCurrentFile()
endfunction
function! s:api(type, task)
exec "silent !python " . s:plugin_directory . "/wakatime.py --key" g:wakatime_api_key "--instance" s:instance_id "--action" a:type "--task" shellescape(a:task) . " &"
if a:task != ''
exec "silent !python " . s:plugin_directory . "/wakatime.py --key" g:wakatime_api_key "--instance" s:instance_id "--action" a:type "--task" shellescape(a:task) . " &"
endif
endfunction
function! s:api_with_time(type, task, time)
exec "silent !python " . s:plugin_directory . "/wakatime.py --key" g:wakatime_api_key "--instance" s:instance_id "--action" a:type "--task" shellescape(a:task) "--time" printf("%f", a:time) . " &"
if a:task != ''
exec "silent !python " . s:plugin_directory . "/wakatime.py --key" g:wakatime_api_key "--instance" s:instance_id "--action" a:type "--task" shellescape(a:task) "--time" printf("%f", a:time) . " &"
endif
endfunction
function! s:getchar()
@ -103,7 +107,7 @@ function! s:getchar()
return c
endfunction
function! s:isAway()
function! Wakatime_isAway()
return s:away_start
endfunction
@ -111,8 +115,10 @@ function! s:allServersAway()
if has('clientserver')
let servers = split(serverlist())
for server in servers
if !remote_expr(server,'s:isAway()')
return 0
if server != v:servername
if !remote_expr(server,'Wakatime_isAway()')
return 0
endif
endif
endfor
endif