From 1d4d42398055b1979b66a243161f8ee5fc7a19f5 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 2 Jan 2020 12:01:43 -0700 Subject: Add user-registers for arbitrary registers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/nvim/eval/funcs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/eval') diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 0525352e1c..875655d0b3 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -4552,6 +4552,7 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr) "nvim", "colorcolchar", "omnihighlight", + "userreg", }; bool n = false; -- cgit