mirror of
https://github.com/jiriks74/presence.nvim
synced 2024-11-23 20:37:50 +01:00
Add ability to disable the timer (#75)
This commit is contained in:
parent
a3f7c42a4a
commit
03e09d3f9b
@ -44,6 +44,7 @@ require("presence"):setup({
|
|||||||
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
|
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
|
||||||
buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
|
buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
|
||||||
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
|
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
|
||||||
|
show_time = true, -- Show the timer
|
||||||
|
|
||||||
-- Rich Presence text options
|
-- Rich Presence text options
|
||||||
editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
|
editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
|
||||||
@ -70,6 +71,7 @@ let g:presence_enable_line_number = 0
|
|||||||
let g:presence_blacklist = []
|
let g:presence_blacklist = []
|
||||||
let g:presence_buttons = 1
|
let g:presence_buttons = 1
|
||||||
let g:presence_file_assets = {}
|
let g:presence_file_assets = {}
|
||||||
|
let g:presence_show_time = 1
|
||||||
|
|
||||||
" Rich Presence text options
|
" Rich Presence text options
|
||||||
let g:presence_editing_text = "Editing %s"
|
let g:presence_editing_text = "Editing %s"
|
||||||
|
@ -121,6 +121,7 @@ function Presence:setup(options)
|
|||||||
self:set_option("line_number_text", "Line %s out of %s")
|
self:set_option("line_number_text", "Line %s out of %s")
|
||||||
self:set_option("blacklist", {})
|
self:set_option("blacklist", {})
|
||||||
self:set_option("buttons", true)
|
self:set_option("buttons", true)
|
||||||
|
self:set_option("show_time", true)
|
||||||
-- File assets options
|
-- File assets options
|
||||||
self:set_option("file_assets", {})
|
self:set_option("file_assets", {})
|
||||||
for name, asset in pairs(default_file_assets) do
|
for name, asset in pairs(default_file_assets) do
|
||||||
@ -820,9 +821,9 @@ function Presence:update_for_buffer(buffer, should_debounce)
|
|||||||
local activity = {
|
local activity = {
|
||||||
state = status_text,
|
state = status_text,
|
||||||
assets = assets,
|
assets = assets,
|
||||||
timestamps = {
|
timestamps = self.options.show_time == 1 and {
|
||||||
start = relative_activity_set_at,
|
start = relative_activity_set_at,
|
||||||
},
|
} or nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Add button that links to the git workspace remote origin url
|
-- 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
|
if self.workspaces[project_path] then
|
||||||
self.workspaces[project_path].updated_at = activity_set_at
|
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,
|
start = self.workspaces[project_path].started_at,
|
||||||
}
|
} or nil
|
||||||
else
|
else
|
||||||
self.workspaces[project_path] = {
|
self.workspaces[project_path] = {
|
||||||
started_at = activity_set_at,
|
started_at = activity_set_at,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user