From 8cb12b346aa37d518dc93053e9832f80f7e20355 Mon Sep 17 00:00:00 2001 From: Danthewaann Date: Tue, 20 May 2025 09:03:22 +0100 Subject: [PATCH] fix: go to file functionality --- lua/octo/autocmds.lua | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lua/octo/autocmds.lua b/lua/octo/autocmds.lua index edd4d3f84..8edcd90fe 100644 --- a/lua/octo/autocmds.lua +++ b/lua/octo/autocmds.lua @@ -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",