Skip to content

Commit

Permalink
fix: Neorg return to most recent file
Browse files Browse the repository at this point in the history
  • Loading branch information
benlubas committed Jul 28, 2024
1 parent 51c1134 commit f637676
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/neorg/modules/core/neorgcmd/commands/return/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ module.on_event = function(event)
local buffers = vim.api.nvim_list_bufs()

local to_delete = {}
for _, buffer in ipairs(buffers) do
for _, buffer in ipairs(vim.iter(buffers):rev():totable()) 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
if not vim.endswith(P(vim.api.nvim_buf_get_name(buffer)), ".norg") then
vim.api.nvim_win_set_buf(0, buffer)
break
else
Expand Down

0 comments on commit f637676

Please sign in to comment.