Skip to content

Commit

Permalink
fix: correctly set workspace_dir & workspace_name
Browse files Browse the repository at this point in the history
  • Loading branch information
vyfor committed Dec 6, 2024
1 parent 8582099 commit a56a856
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/cord/activity/manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ end
function ActivityManager:on_buf_enter()
local new_workspace_dir = vim.fn.expand '%:p:h'
if new_workspace_dir ~= self.workspace_dir then
self.workspace_dir = new_workspace_dir
self.workspace_name = ws_utils.find(self.workspace_dir)
self.workspace_dir = ws_utils.find(new_workspace_dir)
self.workspace_name = vim.fn.fnamemodify(self.workspace_dir, ':t')
if self.config.hooks.on_workspace_change then
local opts = self.last_opts
opts.workspace_dir = self.workspace_dir
Expand All @@ -241,8 +241,8 @@ end
function ActivityManager:on_dir_changed()
local new_workspace_dir = vim.fn.expand '%:p:h'
if new_workspace_dir ~= self.workspace_dir then
self.workspace_dir = new_workspace_dir
self.workspace_name = ws_utils.find(self.workspace_dir)
self.workspace_dir = ws_utils.find(new_workspace_dir)
self.workspace_name = vim.fn.fnamemodify(self.workspace_dir, ':t')
self:queue_update()
end
end
Expand Down

0 comments on commit a56a856

Please sign in to comment.