mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 18:55:14 -07:00
refactor(defaults): always set options, even if value hasn't changed (#26595)
Comparing against the old value before setting matched the original C implementation, but there is no reason to use this restriction. In particular, this inhibits using OptionSet to determine when the option was set. If users need to handle a case where the option _changed_, it is easy to do so in an OptionSet autocommand using v:option_new and v:option_old (and friends).
This commit is contained in:
parent
0d26d192d8
commit
f4f7e29469
@ -189,9 +189,7 @@ if tty then
|
||||
-- Wait until Nvim is finished starting to set the option to ensure the
|
||||
-- OptionSet event fires.
|
||||
if vim.v.vim_did_enter == 1 then
|
||||
if vim.o[option] ~= value then
|
||||
vim.o[option] = value
|
||||
end
|
||||
vim.o[option] = value
|
||||
else
|
||||
vim.api.nvim_create_autocmd('VimEnter', {
|
||||
once = true,
|
||||
|
Loading…
Reference in New Issue
Block a user