aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mapping.h
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
commit21cb7d04c387e4198ca8098a884c78b56ffcf4c2 (patch)
tree84fe5690df1551f0bb2bdfe1a13aacd29ebc1de7 /src/nvim/mapping.h
parentd9c904f85a23a496df4eb6be42aa43f007b22d50 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-colorcolchar.tar.gz
rneovim-colorcolchar.tar.bz2
rneovim-colorcolchar.zip
Merge remote-tracking branch 'upstream/master' into colorcolcharcolorcolchar
Diffstat (limited to 'src/nvim/mapping.h')
-rw-r--r--src/nvim/mapping.h78
1 files changed, 20 insertions, 58 deletions
diff --git a/src/nvim/mapping.h b/src/nvim/mapping.h
index 58e28810bc..ffe7ab4290 100644
--- a/src/nvim/mapping.h
+++ b/src/nvim/mapping.h
@@ -1,63 +1,25 @@
-#ifndef NVIM_MAPPING_H
-#define NVIM_MAPPING_H
-
-#include <stdbool.h>
-#include <stddef.h>
-
-#include "lauxlib.h"
-#include "nvim/buffer_defs.h"
-#include "nvim/ex_cmds_defs.h"
-#include "nvim/types.h"
-#include "nvim/vim.h"
-
-/// All possible |:map-arguments| usable in a |:map| command.
-///
-/// The <special> argument has no effect on mappings and is excluded from this
-/// struct declaration. |:noremap| is included, since it behaves like a map
-/// argument when used in a mapping.
-///
-/// @see mapblock_T
-struct map_arguments {
- bool buffer;
- bool expr;
- bool noremap;
- bool nowait;
- bool script;
- bool silent;
- bool unique;
- bool replace_keycodes;
-
- /// The {lhs} of the mapping.
- ///
- /// vim limits this to MAXMAPLEN characters, allowing us to use a static
- /// buffer. Setting lhs_len to a value larger than MAXMAPLEN can signal
- /// that {lhs} was too long and truncated.
- char lhs[MAXMAPLEN + 1];
- size_t lhs_len;
-
- /// Unsimplifed {lhs} of the mapping. If no simplification has been done then alt_lhs_len is 0.
- char alt_lhs[MAXMAPLEN + 1];
- size_t alt_lhs_len;
-
- char *rhs; /// The {rhs} of the mapping.
- size_t rhs_len;
- LuaRef rhs_lua; /// lua function as {rhs}
- bool rhs_is_noop; /// True when the {rhs} should be <Nop>.
-
- char *orig_rhs; /// The original text of the {rhs}.
- size_t orig_rhs_len;
- char *desc; /// map description
+#pragma once
+
+#include <stdint.h> // IWYU pragma: keep
+#include <stdio.h> // IWYU pragma: keep
+
+#include "nvim/api/keysets_defs.h" // IWYU pragma: keep
+#include "nvim/api/private/defs.h" // IWYU pragma: keep
+#include "nvim/cmdexpand_defs.h" // IWYU pragma: keep
+#include "nvim/eval/typval_defs.h" // IWYU pragma: keep
+#include "nvim/ex_cmds_defs.h" // IWYU pragma: keep
+#include "nvim/mapping_defs.h" // IWYU pragma: export
+#include "nvim/option_defs.h" // IWYU pragma: keep
+#include "nvim/regexp_defs.h" // IWYU pragma: keep
+#include "nvim/types_defs.h" // IWYU pragma: keep
+
+/// Used for the first argument of do_map()
+enum {
+ MAPTYPE_MAP = 0,
+ MAPTYPE_UNMAP = 1,
+ MAPTYPE_NOREMAP = 2,
};
-typedef struct map_arguments MapArguments;
-#define MAP_ARGUMENTS_INIT { false, false, false, false, false, false, false, false, \
- { 0 }, 0, { 0 }, 0, NULL, 0, LUA_NOREF, false, NULL, 0, NULL }
-
-// Used for the first argument of do_map()
-#define MAPTYPE_MAP 0
-#define MAPTYPE_UNMAP 1
-#define MAPTYPE_NOREMAP 2
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "mapping.h.generated.h"
#endif
-#endif // NVIM_MAPPING_H