Send options on startup as well as on changed except for columns and rows (#2315)

* Send options on startup as well as on changed except for columns and rows

* Don't check all options when observing changes and only add an autocmd for startup once
This commit is contained in:
Kaylee Simmons 2024-01-28 02:37:46 -08:00 committed by GitHub
parent 4e7ee7d1e2
commit 2b00f9eb5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -88,6 +88,20 @@ for _,option_setting in ipairs(args.option_settings) do
})
end
-- Ignore initial values of lines and columns because they are set by neovim directly.
-- See https://github.com/neovide/neovide/issues/2300
vim.api.nvim_create_autocmd({ "VimEnter" }, {
once = true,
nested = true,
callback = function()
for _,option_setting in ipairs(args.option_settings) do
if option_setting ~= "lines" and option_setting ~= "columns" then
rpcnotify("option_changed", option_setting, vim.o[option_setting])
end
end
end
})
-- Create auto command for retrieving exit code from neovim on quit.
vim.api.nvim_create_autocmd({ "VimLeavePre" }, {
pattern = "*",