Skip to content

Commit

Permalink
fix: always set buftype=nofile on nui popup/splits. Fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Sep 30, 2022
1 parent dee23c2 commit 0d5be0c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/noice/ui/popupmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function M.on_show(_, items, selected)
)
end
local cursor = Cmdline.message.cursor
if cursor then
if cursor and cursor.buf_line then
local win = vim.fn.bufwinid(cursor.buf)
if win ~= -1 then
M.no_cmdline_mode = true
Expand Down
2 changes: 1 addition & 1 deletion lua/noice/view/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ local NuiView = View:extend("NuiView")

function NuiView:create()
self._layout = self:get_layout()
local opts = vim.tbl_deep_extend("force", self._opts, self._layout)
local opts = vim.tbl_deep_extend("force", { buf_options = { buftype = "nofile" } }, self._opts, self._layout)

self._nui = self._opts.type == "split" and require("nui.split")(opts) or require("nui.popup")(opts)

Expand Down

0 comments on commit 0d5be0c

Please sign in to comment.