Skip to content

Commit

Permalink
fix(bbye): focusing unloaded buffers w/ focus_on_close == 'previous'
Browse files Browse the repository at this point in the history
  • Loading branch information
Iron-E committed May 16, 2023
1 parent b2a99b4 commit 4bd916c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/barbar/bbye.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
-- http://www.gnu.org/licenses.

local buf_get_option = vim.api.nvim_buf_get_option --- @type function
local buf_is_loaded = vim.api.nvim_buf_is_loaded --- @type function
local buf_set_option = vim.api.nvim_buf_set_option --- @type function
local buflisted = vim.fn.buflisted --- @type function
local bufnr = vim.fn.bufnr --- @type function
Expand Down Expand Up @@ -83,7 +84,7 @@ local function get_focus_on_close(closing_number)

if focus_on_close == 'previous' then
local previous = bufnr('#')
if previous > -1 then
if buf_is_loaded(previous) then
return previous
end
end
Expand Down

0 comments on commit 4bd916c

Please sign in to comment.