mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
Make the window nomodifiable
when it's created
This commit is contained in:
@@ -594,7 +594,6 @@ function M.focusable_float(unique_name, fn)
|
|||||||
if win then
|
if win then
|
||||||
api.nvim_set_current_win(win)
|
api.nvim_set_current_win(win)
|
||||||
api.nvim_command("stopinsert")
|
api.nvim_command("stopinsert")
|
||||||
api.nvim_buf_set_option(0, 'modifiable', false)
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -736,6 +735,7 @@ function M.fancy_floating_markdown(contents, opts)
|
|||||||
local bufnr = api.nvim_create_buf(false, true)
|
local bufnr = api.nvim_create_buf(false, true)
|
||||||
local winnr = api.nvim_open_win(bufnr, false, M.make_floating_popup_options(width, height, opts))
|
local winnr = api.nvim_open_win(bufnr, false, M.make_floating_popup_options(width, height, opts))
|
||||||
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, stripped)
|
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, stripped)
|
||||||
|
api.nvim_buf_set_option(bufnr, 'modifiable', false)
|
||||||
|
|
||||||
-- Switch to the floating window to apply the syntax highlighting.
|
-- Switch to the floating window to apply the syntax highlighting.
|
||||||
-- This is because the syntax command doesn't accept a target.
|
-- This is because the syntax command doesn't accept a target.
|
||||||
|
Reference in New Issue
Block a user