with status update
This commit is contained in:
19
lua/github_presence/updates.lua
Normal file
19
lua/github_presence/updates.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
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
|
Reference in New Issue
Block a user