diff options
| author | Volodymyr Chernetskyi <volodymyr_chernetskyi@goodyear.com> | 2026-09-04 17:18:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-04 11:18:22 -0400 |
| commit | f22b01775979845784a7472faf239a05f693ded4 (patch) | |
| tree | 1adf68d8c0cb8ced532f8994dffd14dbb1da82c9 /runtime/lua/vim | |
| parent | 6112d4a6741e10401fce0d7728cd89398878a77a (diff) | |
| download | rneovim-f22b01775979845784a7472faf239a05f693ded4.tar.gz rneovim-f22b01775979845784a7472faf239a05f693ded4.tar.bz2 rneovim-f22b01775979845784a7472faf239a05f693ded4.zip | |
fix(menu): menu_get() cannot tell :noremenu from :menu <script> #41686
Problem:
`REMAP_NONE` is -1 and `REMAP_SCRIPT` is -2. These are enumerated
values, not bit flags, so `&` is the wrong operator: `x & -1` is `x`,
and `-1 & -2` is -2, which is truthy. Both kinds of non-remapping menu
therefore reported `noremap` and `sid` as 1 and became
indistinguishable.
The sibling `menu_get_info()` already compares with `==`.
Solution:
Compare rather than mask.
The expectations in menu_spec.lua had the
conflated values baked in, so 22 entries from plain `*noremenu` commands
now report `sid = 0`, and the two from `nnoremenu <script> Export.Script`
now report `noremap = 0`.
AI-assisted
Diffstat (limited to 'runtime/lua/vim')
0 files changed, 0 insertions, 0 deletions