1
0
Fork 0
mirror of https://github.com/jiriks74/presence.nvim synced 2025-06-18 19:28:56 +02:00

Add ability to disable the timer (#75)

This commit is contained in:
William 2022-09-09 19:04:11 -04:00 committed by GitHub
parent a3f7c42a4a
commit 03e09d3f9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions
lua/presence

View file

@ -121,6 +121,7 @@ function Presence:setup(options)
self:set_option("line_number_text", "Line %s out of %s")
self:set_option("blacklist", {})
self:set_option("buttons", true)
self:set_option("show_time", true)
-- File assets options
self:set_option("file_assets", {})
for name, asset in pairs(default_file_assets) do
@ -820,9 +821,9 @@ function Presence:update_for_buffer(buffer, should_debounce)
local activity = {
state = status_text,
assets = assets,
timestamps = {
timestamps = self.options.show_time == 1 and {
start = relative_activity_set_at,
},
} or nil,
}
-- Add button that links to the git workspace remote origin url
@ -870,9 +871,9 @@ function Presence:update_for_buffer(buffer, should_debounce)
if self.workspaces[project_path] then
self.workspaces[project_path].updated_at = activity_set_at
activity.timestamps = {
activity.timestamps = self.options.show_time == 1 and {
start = self.workspaces[project_path].started_at,
}
} or nil
else
self.workspaces[project_path] = {
started_at = activity_set_at,