Unexpected behavior when toggling edgy right pane with weekly notes buffer #131
alloc33
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use my weekly notes with edgy on right pane. It seems to work, but as soon as I toggle the right pane with my weekly notes buffer using
:lua require("edgy").toggle("right")<cr>- it starts to behave strage, e.g. myoutlineedgy window on the left stretches to the right pane, when I toggle right pane again - middle regular buffer is being closed. When I hide-show right pane again - right pane stretches to entire screen. Is there any way to configure it properly or it's not supposed to work with custom buffers?Multiple calls of
..toggle("right"). Expect right pane toggles and nothing else chagnes:https://github.com/user-attachments/assets/5f7d94dd-5db7-484f-b329-0896c31e7697
Here is my current edgy config:
{ "folke/edgy.nvim", event = "VeryLazy", init = function() vim.opt.splitkeep = "screen" vim.opt.laststatus = 3 -- Create a dummy buffer to force proper layout vim.api.nvim_create_autocmd("VimEnter", { callback = function() -- Force immediate layout correction with multiple strategies vim.defer_fn(function() -- Create a temporary buffer and window to force redraw local tmp_buf = vim.api.nvim_create_buf(false, true) local tmp_win = vim.api.nvim_open_win(tmp_buf, false, { relative = "editor", width = 1, height = 1, row = 0, col = 0, style = "minimal", noautocmd = true }) -- Force redraw vim.cmd("redraw!") -- Close the temporary window after a brief moment vim.defer_fn(function() if vim.api.nvim_win_is_valid(tmp_win) then vim.api.nvim_win_close(tmp_win, true) end if vim.api.nvim_buf_is_valid(tmp_buf) then vim.api.nvim_buf_delete(tmp_buf, { force = true }) end -- Focus main window and redraw again require("edgy").goto_main() vim.cmd("redraw!") end, 50) -- Force window equalization vim.cmd("wincmd =") -- Immediately goto main to prevent focus issues require("edgy").goto_main() end, 10) -- Very short delay for immediate effect end }) -- Add additional forced layout fix for when VimEnter completes vim.api.nvim_create_autocmd("VimEnter", { callback = function() vim.schedule(function() require("edgy").goto_main() vim.cmd("redraw!") end) end, once = true, nested = true }) end, opts = { left = { { title = function() local buf_name = vim.api.nvim_buf_get_name(0) or "[No Name]" return vim.fn.fnamemodify(buf_name, ":t") end, ft = "Outline", pinned = true, open = "Outline", size = { width = 40 }, wo = { winfixwidth = true, winfixheight = true, -- Force fixed height number = false, relativenumber = true, } }, }, right = { { title = "Weekly Journal", ft = "markdown", pinned = true, size = { width = 75 }, filter = function(buf) local filename = vim.api.nvim_buf_get_name(buf) return vim.bo[buf].filetype == "markdown" and string.match(filename, "Journal/[0-9]+%-W[0-9]+%.md$") end, open = function() local year = os.date("%Y") local week = os.date("%V") local filepath = "/Users/nshv/Library/Mobile Documents/iCloud~md~obsidian/Documents/NSHV/Journal/" .. year .. "-W" .. week .. ".md" vim.cmd("edit " .. filepath) end, wo = { winfixwidth = true, winfixheight = true, -- Force fixed height wrap = true, number = false, relativenumber = true, } } }, options = { left = { size = 40 }, right = { size = 75 }, bottom = { size = 10 }, top = { size = 10 }, }, animate = { enabled = false, -- Animations can cause layout issues }, exit_when_last = false, close_when_all_hidden = true, wo = { winbar = true, winfixwidth = true, winfixheight = true, winhighlight = "", spell = false, signcolumn = "no", }, -- Force layout correction on every edgy-related event on_layout = function() vim.schedule(function() vim.cmd("redraw!") require("edgy").goto_main() end) end, }, },Beta Was this translation helpful? Give feedback.
All reactions