Mercurial > vim
diff src/getchar.c @ 31211:d6355c3af211 v9.0.0939
patch 9.0.0939: still using simplified mappings when using kitty protocol
Commit: https://github.com/vim/vim/commit/47f1fdc28c6839ec8f5aede631d3a870624767b6
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 24 13:27:36 2022 +0000
patch 9.0.0939: still using simplified mappings when using kitty protocol
Problem: Still using simplified mappings when using the kitty keyboard
protocol.
Solution: Use the kitty_protocol_state value to decide whether to use
simplified mappings. Improve how seenModifyOtherKeys is set and
reset.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 24 Nov 2022 14:30:03 +0100 |
parents | 25f6c7f77c70 |
children | 42acbd0cb313 |
line wrap: on
line diff
--- a/src/getchar.c +++ b/src/getchar.c @@ -2456,6 +2456,17 @@ check_simplify_modifier(int max_offset) } /* + * Return TRUE if the terminal sends modifiers with various keys. This is when + * modifyOtherKeys level 2 is enabled or the kitty keyboard protocol is + * enabled. + */ + static int +key_protocol_enabled(void) +{ + return seenModifyOtherKeys || kitty_protocol_state == KKPS_ENABLED; +} + +/* * Handle mappings in the typeahead buffer. * - When something was mapped, return map_result_retry for recursive mappings. * - When nothing mapped and typeahead has a character: return map_result_get. @@ -2564,7 +2575,7 @@ handle_mapping( // Skip ":lmap" mappings if keys were mapped. if (mp->m_keys[0] == tb_c1 && (mp->m_mode & local_State) - && !(mp->m_simplified && seenModifyOtherKeys + && !(mp->m_simplified && key_protocol_enabled() && typebuf.tb_maplen == 0) && ((mp->m_mode & MODE_LANGMAP) == 0 || typebuf.tb_maplen == 0))