Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lua/presence/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ function Presence:update_for_buffer(buffer, should_debounce)
local filename = self.get_filename(buffer, self.os.path_separator)
local parent_dirpath = self.get_dir_path(buffer, self.os.path_separator)
local extension = filename and self.get_file_extension(filename) or nil
self.log:debug(string.format("Parsed filename %s with %s extension", filename, extension or "no"))
self.log:debug(string.format("Parsed filename %s with %s extension", filename or "no", extension or "no"))

-- Return early if there is no valid activity status text to set
local status_text = self:get_status_text(filename)
Expand All @@ -778,7 +778,7 @@ function Presence:update_for_buffer(buffer, should_debounce)
end

-- Get project information
self.log:debug(string.format("Getting project name for %s...", parent_dirpath))
self.log:debug(string.format("Getting project name for %s...", parent_dirpath or "no"))
local project_name, project_path = self:get_project_name(parent_dirpath)

-- Check for blacklist
Expand All @@ -793,7 +793,9 @@ function Presence:update_for_buffer(buffer, should_debounce)
local activity_set_at = os.time()
-- If we shouldn't debounce and we trigger an activity, keep this value the same.
-- Otherwise set it to the current time.
local relative_activity_set_at = should_debounce and self.last_activity.relative_set_at or os.time()
-- local relative_activity_set_at = should_debounce and self.last_activity.relative_set_at or os.time()
local relative_activity_set_at = self.last_activity.relative_set_at or os.time()


self.log:debug(string.format("Setting activity for %s...", buffer and #buffer > 0 and buffer or "unnamed buffer"))

Expand Down