comparison runtime/menu.vim @ 27859:3cb1a109e987 v8.2.4455

patch 8.2.4455: accepting one and zero for second sort() argument is strange Commit: https://github.com/vim/vim/commit/2007dd49f5cb36f944cab1cfbceb0f864e625f74 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Feb 23 13:17:47 2022 +0000 patch 8.2.4455: accepting one and zero for second sort() argument is strange Problem: Accepting one and zero for the second sort() argument is strange. Solution: Disallow using one and zero in Vim9 script.
author Bram Moolenaar <Bram@vim.org>
date Wed, 23 Feb 2022 14:30:03 +0100
parents 179c118424a6
children c968191a8557
comparison
equal deleted inserted replaced
27858:6197d182d707 27859:3cb1a109e987
1 " Vim support file to define the default menus 1 " Vim support file to define the default menus
2 " You can also use this as a start for your own set of menus. 2 " You can also use this as a start for your own set of menus.
3 " 3 "
4 " Maintainer: Bram Moolenaar <Bram@vim.org> 4 " Maintainer: Bram Moolenaar <Bram@vim.org>
5 " Last Change: 2022 Feb 04 5 " Last Change: 2022 Feb 23
6 6
7 " Note that ":an" (short for ":anoremenu") is often used to make a menu work 7 " Note that ":an" (short for ":anoremenu") is often used to make a menu work
8 " in all modes and avoid side effects from mappings defined by the user. 8 " in all modes and avoid side effects from mappings defined by the user.
9 9
10 " Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise 10 " Make sure the '<' and 'C' flags are not included in 'cpoptions', otherwise
376 var n = globpath(&runtimepath, "colors/*.vim", 1, 1) 376 var n = globpath(&runtimepath, "colors/*.vim", 1, 1)
377 n += globpath(&packpath, "pack/*/start/*/colors/*.vim", 1, 1) 377 n += globpath(&packpath, "pack/*/start/*/colors/*.vim", 1, 1)
378 n += globpath(&packpath, "pack/*/opt/*/colors/*.vim", 1, 1) 378 n += globpath(&packpath, "pack/*/opt/*/colors/*.vim", 1, 1)
379 379
380 # Ignore case for VMS and windows, sort on name 380 # Ignore case for VMS and windows, sort on name
381 var names = sort(map(n, 'substitute(v:val, "\\c.*[/\\\\:\\]]\\([^/\\\\:]*\\)\\.vim", "\\1", "")'), 1) 381 var names = sort(map(n, 'substitute(v:val, "\\c.*[/\\\\:\\]]\\([^/\\\\:]*\\)\\.vim", "\\1", "")'), 'i')
382 382
383 # define all the submenu entries 383 # define all the submenu entries
384 var idx = 100 384 var idx = 100
385 for name in names 385 for name in names
386 exe "an 20.450." .. idx .. ' &Edit.C&olor\ Scheme.' .. name .. " :colors " .. name .. "<CR>" 386 exe "an 20.450." .. idx .. ' &Edit.C&olor\ Scheme.' .. name .. " :colors " .. name .. "<CR>"