fix
This commit is contained in:
parent
d367d166a9
commit
e9eab52653
@ -132,6 +132,20 @@ local function log_time_table()
|
||||
end
|
||||
end
|
||||
|
||||
local function focus_gained()
|
||||
table.insert(focus_events, {
|
||||
time = os.time(),
|
||||
event = "gain",
|
||||
})
|
||||
end
|
||||
|
||||
local function focus_lost()
|
||||
table.insert(focus_events, {
|
||||
time = os.time(),
|
||||
event = "lose",
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
local function persist()
|
||||
local today = os.date("%y-%m-%d", os.time())
|
||||
@ -162,7 +176,7 @@ local function persist()
|
||||
return
|
||||
end
|
||||
|
||||
file:write("## dates and their corresponding seconds been here :)\n", TOML.encode(table), "\n")
|
||||
file:write("## dates and their corresponding seconds been here :)\n", TOML.encode(table), "\n")
|
||||
file.close()
|
||||
|
||||
--reset timer
|
||||
@ -170,19 +184,6 @@ local function persist()
|
||||
focus_events = {}
|
||||
focus_gained()
|
||||
end
|
||||
local function focus_gained()
|
||||
table.insert(focus_events, {
|
||||
time = os.time(),
|
||||
event = "gain",
|
||||
})
|
||||
end
|
||||
|
||||
local function focus_lost()
|
||||
table.insert(focus_events, {
|
||||
time = os.time(),
|
||||
event = "lose",
|
||||
})
|
||||
end
|
||||
|
||||
local function setup()
|
||||
vim.api.nvim_create_autocmd("VimEnter",
|
||||
|
Loading…
Reference in New Issue
Block a user