mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
fix(options): correct condition for calling did_set_option() (#25026)
This commit is contained in:
@@ -3772,7 +3772,7 @@ static const char *set_option(int opt_idx, void *varp, OptVal *v, int opt_flags,
|
|||||||
errbuf, errbuflen);
|
errbuf, errbuflen);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errmsg != NULL) {
|
if (errmsg == NULL) {
|
||||||
did_set_option(opt_idx, opt_flags, true, value_checked);
|
did_set_option(opt_idx, opt_flags, true, value_checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1416,6 +1416,20 @@ describe('API', function()
|
|||||||
eq(true, status)
|
eq(true, status)
|
||||||
eq(' equalalways\n\tLast set from Lua', rv)
|
eq(' equalalways\n\tLast set from Lua', rv)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('updates whether the option has ever been set #25025', function()
|
||||||
|
eq(false, nvim('get_option_info2', 'autochdir', {}).was_set)
|
||||||
|
nvim('set_option_value', 'autochdir', true, {})
|
||||||
|
eq(true, nvim('get_option_info2', 'autochdir', {}).was_set)
|
||||||
|
|
||||||
|
eq(false, nvim('get_option_info2', 'cmdwinheight', {}).was_set)
|
||||||
|
nvim('set_option_value', 'cmdwinheight', 10, {})
|
||||||
|
eq(true, nvim('get_option_info2', 'cmdwinheight', {}).was_set)
|
||||||
|
|
||||||
|
eq(false, nvim('get_option_info2', 'debug', {}).was_set)
|
||||||
|
nvim('set_option_value', 'debug', 'beep', {})
|
||||||
|
eq(true, nvim('get_option_info2', 'debug', {}).was_set)
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('nvim_get_option_value, nvim_set_option_value', function()
|
describe('nvim_get_option_value, nvim_set_option_value', function()
|
||||||
|
Reference in New Issue
Block a user