From e5e797e6eddcb6efb1d2c3fc2612b31ad9a76cef Mon Sep 17 00:00:00 2001 From: Ben Lubas Date: Sat, 27 Jul 2024 23:51:53 -0400 Subject: [PATCH] fix: Neorg return to most recent file --- lua/neorg/modules/core/neorgcmd/commands/return/module.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/neorg/modules/core/neorgcmd/commands/return/module.lua b/lua/neorg/modules/core/neorgcmd/commands/return/module.lua index 12e93a38c..7e340a8b9 100644 --- a/lua/neorg/modules/core/neorgcmd/commands/return/module.lua +++ b/lua/neorg/modules/core/neorgcmd/commands/return/module.lua @@ -32,7 +32,7 @@ module.on_event = function(event) local buffers = vim.api.nvim_list_bufs() local to_delete = {} - for _, buffer in ipairs(buffers) do + for buffer in vim.iter(buffers):rev() do if vim.fn.buflisted(buffer) == 1 then -- If the listed buffer we're working with has a .norg extension then remove it (not forcibly) if not vim.endswith(vim.api.nvim_buf_get_name(buffer), ".norg") then