Skip to content

Commit

Permalink
fix: make nui views nomodifiable
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Oct 26, 2022
1 parent 83c837e commit f674f03
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lua/noice/view/nui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,6 @@ function NuiView:show()
self._nui:mount()
end

if self._nui.bufnr then
vim.api.nvim_buf_set_lines(self._nui.bufnr, 0, -1, false, {})
end

self._nui:show()
self:set_win_options(self._nui.winid)
if not self._visible then
Expand All @@ -213,7 +209,10 @@ function NuiView:show()

self:tag()

vim.bo[self._nui.bufnr].modifiable = true
self:render(self._nui.bufnr)
vim.bo[self._nui.bufnr].modifiable = false

self._scroll.winnr = self._nui.winid
self._scroll:show()
self:fix_border()
Expand Down

0 comments on commit f674f03

Please sign in to comment.