aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2020-01-02 12:01:43 -0700
committerJosh Rahm <rahm@google.com>2022-01-11 14:31:07 -0700
commit1d4d42398055b1979b66a243161f8ee5fc7a19f5 (patch)
treeb8c4a68041ac9f60c53f2f2b34184a3557656e74 /src/nvim/eval.c
parent3b1675cc6215851fcf5c9274d6913539a7c97da6 (diff)
downloadrneovim-1d4d42398055b1979b66a243161f8ee5fc7a19f5.tar.gz
rneovim-1d4d42398055b1979b66a243161f8ee5fc7a19f5.tar.bz2
rneovim-1d4d42398055b1979b66a243161f8ee5fc7a19f5.zip
Add user-registers for arbitrary registers.
This allows users to define behaviors for arbitrary registers. These registers can be any character including multibyte characters. This means that any character may be used as a register and if that register is not a builtin register, it will defer to a user-defined vimscript function for behavior. This is done throw an option called 'userregfun' The function that 'userregfun' defines is a function that takes 3 arguments: action - Either set to "put" or "yank" register - The character representing the register. content - If the action is "yank" this string contains the content yanked. Multibyte registers are still broken for expressions. So while let @&=xyz Works as expected, let @λ=xyz will still throw a parse error.
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 6dbdc09c3b..a1c832bca5 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -5313,7 +5313,7 @@ bool garbage_collect(bool testing)
// registers (ShaDa additional data)
{
- const void *reg_iter = NULL;
+ iter_register_T reg_iter = ITER_REGISTER_NULL;
do {
yankreg_T reg;
char name = NUL;
@@ -5322,7 +5322,7 @@ bool garbage_collect(bool testing)
if (name != NUL) {
ABORTING(set_ref_dict)(reg.additional_data, copyID);
}
- } while (reg_iter != NULL);
+ } while (reg_iter != ITER_REGISTER_NULL);
}
// global marks (ShaDa additional data)