From 02ad6aa5cec17aac63a49de36c948893402635d9 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Wed, 10 Jul 2013 00:21:47 -0700 Subject: [PATCH] prevent writing to data file more than once in 5 seconds --- plugin/wakatime.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/wakatime.vim b/plugin/wakatime.vim index a674f05..7f31521 100644 --- a/plugin/wakatime.vim +++ b/plugin/wakatime.vim @@ -181,7 +181,9 @@ let s:VERSION = '0.2.1' call s:Api(targetFile, now, last[0], 0, last) endif else - call s:SetLastAction(last[0], targetFile) + if now - last[1] > 5: + call s:SetLastAction(last[0], targetFile) + endif endif endfunction