neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 60701f4fff8a45956f74df429b4361447ffe7f3d
parent c559ab0ae6bebd565862dd28b39947a07766846d
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Sun,  4 Feb 2024 06:42:47 +0800

vim-patch:9.1.0073: Looping over modifier_keys_table unnecessarily

Problem:  Looping over modifier_keys_table[] unnecessarily with only
          MOD_MASK_ALT or MOD_MASK_CMD, as modifier_keys_table[] only
          contains MOD_MASK_SHIFT and MOD_MASK_CTRL, and the loop won't
          do anything.
Solution: Remove MOD_MASK_ALT and MOD_MASK_CMD from the condition.
          (zeertzjq)

closes: vim/vim#13963

https://github.com/vim/vim/commit/0c989e4a3ae50085aa8c6bed5d6701760191bc1d

Diffstat:
Msrc/nvim/keycodes.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nvim/keycodes.c b/src/nvim/keycodes.c @@ -400,7 +400,7 @@ int name_to_mod_mask(int c) int simplify_key(const int key, int *modifiers) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { - if (!(*modifiers & (MOD_MASK_SHIFT | MOD_MASK_CTRL | MOD_MASK_ALT))) { + if (!(*modifiers & (MOD_MASK_SHIFT | MOD_MASK_CTRL))) { return key; }