refactor: run IWYU on entire repo

Reference: https://github.com/neovim/neovim/issues/6371.
This commit is contained in:
dundargoc
2023-12-18 10:55:23 +01:00
committed by dundargoc
parent ade42d531b
commit af93a74a0f
123 changed files with 314 additions and 462 deletions

View File

@@ -13,6 +13,10 @@
#include "nvim/regexp_defs.h" // IWYU pragma: keep
#include "nvim/types_defs.h" // IWYU pragma: keep
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "mapping.h.generated.h"
#endif
/// Used for the first argument of do_map()
enum {
MAPTYPE_MAP = 0,
@@ -20,6 +24,23 @@ enum {
MAPTYPE_NOREMAP = 2,
};
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "mapping.h.generated.h"
#endif
/// Adjust chars in a language according to 'langmap' option.
/// NOTE that there is no noticeable overhead if 'langmap' is not set.
/// When set the overhead for characters < 256 is small.
/// Don't apply 'langmap' if the character comes from the Stuff buffer or from a
/// mapping and the langnoremap option was set.
/// The do-while is just to ignore a ';' after the macro.
#define LANGMAP_ADJUST(c, condition) \
do { \
if (*p_langmap \
&& (condition) \
&& (p_lrm || (vgetc_busy ? typebuf_maplen() == 0 : KeyTyped)) \
&& !KeyStuffed \
&& (c) >= 0) \
{ \
if ((c) < 256) \
c = langmap_mapchar[c]; \
else \
c = langmap_adjust_mb(c); \
} \
} while (0)