Skip to content

Commit

Permalink
Merge pull request #554 from folke/load_correct_buffer
Browse files Browse the repository at this point in the history
fix: load octo in the correct buffer
  • Loading branch information
pwntester committed Jun 8, 2024
2 parents 27d288e + a36cfd0 commit 0887ee9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lua/octo/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ function M.setup()
define({ "BufReadCmd" }, {
group = "octo_autocmds",
pattern = { "octo://*" },
callback = function()
require("octo").load_buffer()
callback = function(ev)
require("octo").load_buffer(ev.buf)
end,
})
define({ "BufWriteCmd" }, {
Expand Down
4 changes: 3 additions & 1 deletion lua/octo/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ function M.load_buffer(bufnr)
return
end
M.load(repo, kind, number, function(obj)
M.create_buffer(kind, obj, repo, false)
vim.api.nvim_buf_call(bufnr, function()
M.create_buffer(kind, obj, repo, false)
end)
end)
end

Expand Down

0 comments on commit 0887ee9

Please sign in to comment.