diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-06-23 21:17:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-23 21:17:11 +0800 |
commit | 7718b758461265d8966468c104ce5454538471e2 (patch) | |
tree | c58cec1a66defb6c84c113cb76c03e759db47feb /src/nvim/getchar.h | |
parent | 05ca14a8810555495c309b8add3002773c77123d (diff) | |
download | rneovim-7718b758461265d8966468c104ce5454538471e2.tar.gz rneovim-7718b758461265d8966468c104ce5454538471e2.tar.bz2 rneovim-7718b758461265d8966468c104ce5454538471e2.zip |
refactor: move some mapping-related code to a separate file (#19061)
This marks the following Vim patches as ported:
vim-patch:8.1.1785: map functionality mixed with character input
Problem: Map functionality mixed with character input.
Solution: Move the map functionality to a separate file. (Yegappan
Lakshmanan, closes vim/vim#4740) Graduate the +localmap feature.
https://github.com/vim/vim/commit/b66bab381c8ba71fd6e92327d1d34c6f8a65f2a7
vim-patch:8.2.3643: header for source file is outdated
Problem: Header for source file is outdated.
Solution: Make the header more accurate. (closes vim/vim#9186)
https://github.com/vim/vim/commit/a3f83feb63eae5464a620ae793c002eb45f7a838
Also cherry-pick a change for <unique> mappings from patch 8.2.0807.
Rename map_clear_mode() to do_mapclear().
Diffstat (limited to 'src/nvim/getchar.h')
-rw-r--r-- | src/nvim/getchar.h | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/nvim/getchar.h b/src/nvim/getchar.h index ddd6d81aef..6996b00c6e 100644 --- a/src/nvim/getchar.h +++ b/src/nvim/getchar.h @@ -1,10 +1,7 @@ #ifndef NVIM_GETCHAR_H #define NVIM_GETCHAR_H -#include "nvim/buffer_defs.h" -#include "nvim/ex_cmds_defs.h" #include "nvim/os/fileio.h" -#include "nvim/types.h" #include "nvim/vim.h" /// Values for "noremap" argument of ins_typebuf() @@ -24,47 +21,6 @@ typedef enum { FLUSH_INPUT, // flush typebuf and inchar() input } flush_buffers_T; -/// 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; - - /// 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_u 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_u alt_lhs[MAXMAPLEN + 1]; - size_t alt_lhs_len; - - char_u *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_u *orig_rhs; /// The original text of the {rhs}. - size_t orig_rhs_len; - char *desc; /// map description -}; -typedef struct map_arguments MapArguments; -#define MAP_ARGUMENTS_INIT { false, false, false, false, false, false, false, \ - { 0 }, 0, { 0 }, 0, NULL, 0, LUA_NOREF, false, NULL, 0, NULL } - #define KEYLEN_PART_KEY (-1) // keylen value for incomplete key-code #define KEYLEN_PART_MAP (-2) // keylen value for incomplete mapping |