From 94af2d0f323f932332a299d81cb0750c3a591d06 Mon Sep 17 00:00:00 2001 From: NotCreative21 Date: Tue, 29 Mar 2022 21:30:48 -0400 Subject: [PATCH 1/3] prevent error messages when opening unnamed buffer --- lua/presence/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/presence/init.lua b/lua/presence/init.lua index 58edf3b..aceeda7 100644 --- a/lua/presence/init.lua +++ b/lua/presence/init.lua @@ -765,7 +765,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) From 5dd874d2ab59a496d6755650def00bcb2eb6d96a Mon Sep 17 00:00:00 2001 From: NotCreative21 Date: Sun, 3 Apr 2022 23:42:38 -0400 Subject: [PATCH 2/3] fix additional cause of error --- lua/presence/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/presence/init.lua b/lua/presence/init.lua index aceeda7..56e76e9 100644 --- a/lua/presence/init.lua +++ b/lua/presence/init.lua @@ -774,7 +774,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 From a6d83d54ed5d6e6b18bd1f0e71c03782a3dfc62c Mon Sep 17 00:00:00 2001 From: Sean Ray <61510083+notseanray@users.noreply.github.com> Date: Fri, 30 Dec 2022 20:07:01 -0500 Subject: [PATCH 3/3] correct time elapsed refreshing on line change --- lua/presence/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/presence/init.lua b/lua/presence/init.lua index ad80457..01625ac 100644 --- a/lua/presence/init.lua +++ b/lua/presence/init.lua @@ -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"))