From b8e227b621468a6ce968f631e4b933f7c12e6955 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 9 Dec 2023 07:18:21 +0800 Subject: vim-patch:9.0.2154: The option[] array is not sorted (#26475) Problem: The options[] array is not sorted alphabetically. Solution: Sort it alphabetically. Add a test. Avoid unnecessary loop iterations in findoption(). closes: vim/vim#13648 Cherry-pick Test_set_one_column() change from patch 8.2.0432. https://github.com/vim/vim/commit/f48558e10a08a1a483e25ef847bbceeac6b44561 --- test/old/testdir/test_options.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/old/testdir/test_options.vim b/test/old/testdir/test_options.vim index d69828dc2e..2bba86fe99 100644 --- a/test/old/testdir/test_options.vim +++ b/test/old/testdir/test_options.vim @@ -950,8 +950,10 @@ endfunc func Test_set_one_column() let out_mult = execute('set all')->split("\n") let out_one = execute('set! all')->split("\n") - " one column should be two to four times as many lines - call assert_inrange(len(out_mult) * 2, len(out_mult) * 4, len(out_one)) + call assert_true(len(out_mult) < len(out_one)) + call assert_equal(out_one[0], '--- Options ---') + let options = out_one[1:]->mapnew({_, line -> line[2:]}) + call assert_equal(sort(copy(options)), options) endfunc func Test_set_values() -- cgit