fix: deal with default_workspace option (#114)

This commit is contained in:
JINNOUCHI Yasushi 2023-08-07 07:38:21 +09:00 committed by GitHub
parent 0615dd6343
commit 2ffcfd00ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -164,6 +164,7 @@ end
---@param tag string?
---@return string?
function Picker:get_workspace(cwd, tag)
tag = tag or self.config.default_workspace_tag
if not tag then
return nil
elseif self.config.workspaces[tag] then
@ -236,7 +237,7 @@ function Picker:on_input_filter_cb(picker_opts)
if prompt == "" then
workspace = self:get_workspace(picker_opts.cwd, self.config.initial_workspace_tag)
else
workspace = self:get_workspace(picker_opts.cwd, tag or self.config.default_workspace_tag) or self.workspace
workspace = self:get_workspace(picker_opts.cwd, tag) or self.workspace
end
if self.workspace ~= workspace then
self.workspace = workspace