Skip to content

Commit e9d9a35

Browse files
committed
Set nobuflisted for infoview buffers.
We do this in the ftplugin as we don't (yet?) use nvim_create_buf to open them, given we have some logic for orientation... If/when we do, nvim_create_buf obviously takes its own option to immediately mark the buffer as nolisted.
1 parent bf94a7b commit e9d9a35

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ftplugin/leaninfo.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
vim.bo.buflisted = false -- because we don't use nvim_create_buf (yet?)
12
vim.bo.modifiable = false
23
vim.bo.undolevels = -1
34
vim.wo.cursorline = false

spec/infoview/open_close_spec.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ describe('infoview open/close', function()
6363
assert.is.falsy(vim.wo[lean_window].winfixwidth)
6464
end)
6565

66+
it('is unlisted', function()
67+
local current_infoview = infoview.get_current_infoview()
68+
local bufnr = vim.api.nvim_win_get_buf(current_infoview.window)
69+
assert.is_false(vim.bo[bufnr].buflisted)
70+
end)
71+
6672
it('closes via its Lua API and stays closed', function()
6773
infoview.get_current_infoview():close()
6874
assert.windows.are(lean_window)

0 commit comments

Comments
 (0)