Skip to content

Commit

Permalink
fix: add async msg for async calls without original msg
Browse files Browse the repository at this point in the history
  • Loading branch information
finxxi authored and xixiaofinland committed Aug 17, 2024
1 parent 6aa7809 commit fc19528
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions lua/sf/org.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ function Org.open()
-- local cmd = 'sf org open -o ' .. U.get()
local cmd = B:new():cmd('org'):act('open'):build()
local err_msg = 'Command failed: ' .. cmd
U.silent_job_call(cmd, nil, err_msg)
U.job_call(cmd, nil, err_msg)
end

function Org.open_current_file()
-- local cmd = vim.fn.expandcmd('sf org open --source-file "%:p" -o ') .. U.get()
local cmd = B:new():cmd('org'):act('open'):addParams('-f', '%:p'):build()
local err_msg = 'Command failed: ' .. cmd
U.silent_job_call(cmd, nil, err_msg)
U.job_call(cmd, nil, err_msg)
end

-- helpers;
Expand All @@ -46,13 +46,6 @@ H.clean_org_cache = function()
H.orgs = {}
end

H.open = function()
-- local cmd = 'sf org open -o ' .. U.get()
local cmd = B:new():cmd('org'):act('open'):build()
local err_msg = 'Command failed: ' .. cmd
U.silent_job_call(cmd, nil, err_msg)
end

H.set_target_org = function()
U.is_table_empty(H.orgs)
vim.ui.select(H.orgs, {
Expand Down Expand Up @@ -81,8 +74,7 @@ H.set_global_target_org = function()
}, function(choice)
if choice ~= nil then
local org = string.gsub(choice, '%[S%] ', '')
-- local cmd = 'sf config set target-org --global ' .. org
local cmd = B:new():cmd('config'):act('set target-org'):addParams('--global'):build() .. ' ' .. org
local cmd = 'sf config set target-org --global ' .. org
local msg = 'Global target_org set: ' .. org
local err_msg = string.format('Global set target_org [%s] failed!', org)
local cb = function()
Expand Down

0 comments on commit fc19528

Please sign in to comment.