Skip to content

Commit 6ffd00f

Browse files
committed
fix: fix issue where neogit mapping still exists of diffview after
unloading
1 parent b19e99e commit 6ffd00f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lua/neogit/integrations/diffview.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ M.diffview_mappings = {
2929
neogit.dispatch_refresh()
3030
dv.setup(old_config)
3131
end,
32+
commit = function()
33+
vim.cmd("tabclose")
34+
vim.cmd("Neogit commit")
35+
end,
3236
}
3337

3438
local function cb(name)
@@ -142,7 +146,7 @@ local function get_local_diff_view(selected_file_name)
142146
end
143147

144148
function M.open(section_name, item_name)
145-
old_config = dv_config.get_config()
149+
old_config = vim.deepcopy(dv_config.get_config())
146150

147151
local config = dv_config.get_config()
148152

@@ -178,7 +182,7 @@ function M.open(section_name, item_name)
178182
if view then
179183
view:open()
180184
end
181-
185+
print("Opening diffview: " .. vim.inspect(old_config))
182186
return view
183187
end
184188

0 commit comments

Comments
 (0)