vim-patch:9.1.0775: tests: not enough tests for setting options (#30785)

Problem:  tests: not enough tests for setting options
Solution: Add more comprehensive tests to test_options (Milly).

closes: vim/vim#15856

484facebe4

Restore behavior of &l:option for unset local boolean options that was
accidentally changed in #26429.

Co-authored-by: Milly <milly.ca@gmail.com>
This commit is contained in:
zeertzjq
2024-10-13 08:09:53 +08:00
committed by GitHub
parent 06625f9b3a
commit b56aa80a26
2 changed files with 544 additions and 21 deletions

View File

@@ -1965,14 +1965,12 @@ typval_T optval_as_tv(OptVal value, bool numbool)
case kOptValTypeNil:
break;
case kOptValTypeBoolean:
if (value.data.boolean != kNone) {
if (numbool) {
rettv.v_type = VAR_NUMBER;
rettv.vval.v_number = value.data.boolean == kTrue;
} else {
rettv.v_type = VAR_BOOL;
rettv.vval.v_bool = value.data.boolean == kTrue;
}
if (numbool) {
rettv.v_type = VAR_NUMBER;
rettv.vval.v_number = value.data.boolean;
} else if (value.data.boolean != kNone) {
rettv.v_type = VAR_BOOL;
rettv.vval.v_bool = value.data.boolean == kTrue;
}
break; // return v:null for None boolean value.
case kOptValTypeNumber: