Skip to content

Commit cee438a

Browse files
Merge pull request #45 from jonathanmorris180/fix/issue-39
Fix/issue 39
2 parents 1b3b08b + 0e55ba1 commit cee438a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

lua/salesforce/diff.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ local function expand(t)
8282
end
8383

8484
local function execute_job(args)
85-
local all_args = { "project", "retrieve", "start", unpack(expand(args)) }
85+
local all_args = { "project", "retrieve", "start", "--ignore-conflicts", unpack(expand(args)) } -- always ignore when retrieving temp files
8686
table.insert(all_args, "--json")
8787
Debug:log("diff.lua", "Command: ")
8888
Debug:log("diff.lua", all_args)

lua/salesforce/file_manager.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ end
1515
local M = {}
1616

1717
local executable = Util.get_sf_executable()
18-
local active_file_path = nil
18+
local active_file_path
1919

2020
local function push_to_org_callback(j)
2121
vim.schedule(function()
@@ -70,7 +70,7 @@ local function push_to_org_callback(j)
7070
end
7171
end
7272
if #diagnostics > 0 then
73-
Util.set_error_diagnostics(diagnostics)
73+
Util.set_error_diagnostics(diagnostics, M.current_bufnr)
7474
vim.notify(
7575
string.format(
7676
"Error(s) while pushing %s. Check diagnostics. Overlapping messages from apex_ls have been omitted.",
@@ -180,6 +180,7 @@ local function push(command)
180180

181181
if not M.current_job or not M.current_job:is_running() then
182182
M.current_job = new_job
183+
M.current_bufnr = vim.api.nvim_get_current_buf()
183184
M.current_job:start()
184185
else
185186
Util.notify_command_in_progress("push/pull")
@@ -206,6 +207,7 @@ local function pull(command)
206207

207208
if not M.current_job or not M.current_job:is_running() then
208209
M.current_job = new_job
210+
M.current_bufnr = vim.api.nvim_get_current_buf()
209211
M.current_job:start()
210212
else
211213
Util.notify_command_in_progress("push/pull")

lua/salesforce/util.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,8 @@ local function get_apex_ls_namespace()
131131
end
132132
end
133133

134-
function M.set_error_diagnostics(diagnostics)
134+
function M.set_error_diagnostics(diagnostics, bufnr)
135135
local apex_ls_namespace = get_apex_ls_namespace()
136-
local bufnr = vim.api.nvim_get_current_buf()
137136
-- filter out overlapping diagnostics from apex_ls
138137
local filtered_diagnostics = {}
139138
for _, diagnostic in ipairs(diagnostics) do

0 commit comments

Comments
 (0)