github-presence/lua/github_presence/updates.lua
2022-10-13 22:19:21 +02:00

20 lines
449 B
Lua

local M = {}
M.last_activity = {}
function M.setup() end
function M.set_status()
local current_buffer = vim.api.nvim_get_current_buf()
local buf_name = vim.api.nvim_buf_get_name(current_buffer)
local file_name = buf_name:match(string.format("^.+%s(.+)$", "/"))
if file_name == nil then return end
if file_name == M.last_activity.file then return end
M.last_activity = {
file = file_name,
set_at = os.time(),
}
end
return M