Mercurial > vim
comparison src/os_win32.c @ 32118:04d9dff67d99 v9.0.1390
patch 9.0.1390: FOR_ALL_ macros are defined in an unexpected file
Commit: https://github.com/vim/vim/commit/14113fdf9cb3d588c0d1c3a210246b981cf5aad3
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Tue Mar 7 17:13:51 2023 +0000
patch 9.0.1390: FOR_ALL_ macros are defined in an unexpected file
Problem: FOR_ALL_ macros are defined in an unexpected file.
Solution: Move FOR_ALL_ macros to macros.h. Add FOR_ALL_HASHTAB_ITEMS.
(Yegappan Lakshmanan, closes #12109)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 07 Mar 2023 18:15:04 +0100 |
parents | 4efcb5c68112 |
children | 97255d909654 |
comparison
equal
deleted
inserted
replaced
32117:0741cc777264 | 32118:04d9dff67d99 |
---|---|
1306 int mods = (int)dict_get_number(args, "modifiers"); | 1306 int mods = (int)dict_get_number(args, "modifiers"); |
1307 // Encode the win32 console key modifiers from Vim keyboard modifiers. | 1307 // Encode the win32 console key modifiers from Vim keyboard modifiers. |
1308 if (mods) | 1308 if (mods) |
1309 { | 1309 { |
1310 // If "modifiers" is explicitly set in the args, then we reset any | 1310 // If "modifiers" is explicitly set in the args, then we reset any |
1311 // remembered modifer key state that may have been set from earlier | 1311 // remembered modifier key state that may have been set from |
1312 // mod-key-down events, even if they are not yet unset by earlier | 1312 // earlier mod-key-down events, even if they are not yet unset by |
1313 // mod-key-up events. | 1313 // earlier mod-key-up events. |
1314 s_dwMods = 0; | 1314 s_dwMods = 0; |
1315 if (mods & MOD_MASK_SHIFT) | 1315 if (mods & MOD_MASK_SHIFT) |
1316 ker.dwControlKeyState |= SHIFT_PRESSED; | 1316 ker.dwControlKeyState |= SHIFT_PRESSED; |
1317 if (mods & MOD_MASK_CTRL) | 1317 if (mods & MOD_MASK_CTRL) |
1318 ker.dwControlKeyState |= LEFT_CTRL_PRESSED; | 1318 ker.dwControlKeyState |= LEFT_CTRL_PRESSED; |
2015 semsg(_(e_invalid_value_for_argument_str_str), "event", event); | 2015 semsg(_(e_invalid_value_for_argument_str_str), "event", event); |
2016 return FALSE; | 2016 return FALSE; |
2017 } | 2017 } |
2018 | 2018 |
2019 // Ideally, WriteConsoleInput would be used to inject these low-level | 2019 // Ideally, WriteConsoleInput would be used to inject these low-level |
2020 // events. But, this doesnt work well in the CI test environment. So | 2020 // events. But, this doesn't work well in the CI test environment. So |
2021 // implementing an input_record_buffer instead. | 2021 // implementing an input_record_buffer instead. |
2022 if (input_encoded) | 2022 if (input_encoded) |
2023 lpEventsWritten = write_input_record_buffer(&ir, 1); | 2023 lpEventsWritten = write_input_record_buffer(&ir, 1); |
2024 | 2024 |
2025 // Set flags to execute the event, ie. like feedkeys mode X. | 2025 // Set flags to execute the event, ie. like feedkeys mode X. |
5735 if (ga_grow(gap, 1) == FAIL) | 5735 if (ga_grow(gap, 1) == FAIL) |
5736 return; | 5736 return; |
5737 | 5737 |
5738 if (env != NULL) | 5738 if (env != NULL) |
5739 { | 5739 { |
5740 for (hi = env->dv_hashtab.ht_array; todo > 0; ++hi) | 5740 FOR_ALL_HASHTAB_ITEMS(&env->dv_hashtab, hi, todo) |
5741 { | 5741 { |
5742 if (!HASHITEM_EMPTY(hi)) | 5742 if (!HASHITEM_EMPTY(hi)) |
5743 { | 5743 { |
5744 typval_T *item = &dict_lookup(hi)->di_tv; | 5744 typval_T *item = &dict_lookup(hi)->di_tv; |
5745 WCHAR *wkey = enc_to_utf16((char_u *)hi->hi_key, NULL); | 5745 WCHAR *wkey = enc_to_utf16((char_u *)hi->hi_key, NULL); |