Skip to content
Open
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
22 changes: 12 additions & 10 deletions lua/octo/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ function M.setup()
end,
})

define({ "BufEnter" }, {
group = "octo_autocmds",
pattern = { "*" },
callback = function()
local current_buffer = vim.api.nvim_buf_get_name(0)
if not current_buffer:match "^octo://" then
require("octo").update_layout_for_current_file()
end
end,
})
if config.values.use_local_fs then
define({ "BufEnter" }, {
group = "octo_autocmds",
pattern = { "*" },
callback = function()
local current_buffer = vim.api.nvim_buf_get_name(0)
if not current_buffer:match "^octo://" then
require("octo").update_layout_for_current_file()
end
end,
})
end

define({ "BufReadCmd" }, {
group = "octo_autocmds",
Expand Down