mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
fix(options): correct condition for calling did_set_option() (#25026)
This commit is contained in:
parent
6abc608445
commit
c3e176f6e2
@ -3772,7 +3772,7 @@ static const char *set_option(int opt_idx, void *varp, OptVal *v, int opt_flags,
|
||||
errbuf, errbuflen);
|
||||
}
|
||||
|
||||
if (errmsg != NULL) {
|
||||
if (errmsg == NULL) {
|
||||
did_set_option(opt_idx, opt_flags, true, value_checked);
|
||||
}
|
||||
|
||||
|
@ -1416,6 +1416,20 @@ describe('API', function()
|
||||
eq(true, status)
|
||||
eq(' equalalways\n\tLast set from Lua', rv)
|
||||
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)
|
||||
|
||||
describe('nvim_get_option_value, nvim_set_option_value', function()
|
||||
|
Loading…
Reference in New Issue
Block a user