Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/blame/commit_info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function CommitInfo:close(cleanup)
then
vim.api.nvim_win_close(self.commit_info_window, true)
end
if self.saved_win and self.saved_pos then
if self.saved_win and self.saved_pos and vim.api.nvim_win_is_valid(self.saved_win) then
vim.api.nvim_set_current_win(self.saved_win)
vim.api.nvim_win_set_cursor(self.saved_win, self.saved_pos)
end
Expand Down
6 changes: 5 additions & 1 deletion lua/blame/views/window_view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ end

function WindowView:close(cleanup)
if self.blame_window ~= nil then
vim.api.nvim_del_augroup_by_name("NvimBlame")
self.blame_stack_client:close()

--if original window still present *Reset options*
Expand All @@ -256,6 +255,8 @@ function WindowView:close(cleanup)
"User",
{ pattern = "BlameViewClosed", modeline = false, data = "window" }
)

vim.api.nvim_del_augroup_by_name("NvimBlame")
self.original_window = nil
self.blame_window = nil
self.blamed_lines = nil
Expand Down Expand Up @@ -342,6 +343,9 @@ function WindowView:show_full_commit()
local row, _ = unpack(vim.api.nvim_win_get_cursor(self.blame_window))
local commit = self.blamed_lines[row]
local view = self.config.commit_detail_view or "tab"
if self.commit_info:is_open() == true then
self.commit_info:close(false)
end
if type(view) == 'function' then
local path = self.blame_stack_client.file_path
view(commit.hash, row, path)
Expand Down