diff options
author | Josh Rahm <rahm@google.com> | 2020-01-02 12:01:43 -0700 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2022-01-11 14:31:07 -0700 |
commit | 1d4d42398055b1979b66a243161f8ee5fc7a19f5 (patch) | |
tree | b8c4a68041ac9f60c53f2f2b34184a3557656e74 /src/nvim/option.c | |
parent | 3b1675cc6215851fcf5c9274d6913539a7c97da6 (diff) | |
download | rneovim-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/option.c')
-rw-r--r-- | src/nvim/option.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 80f74f9d4a..80a6596469 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -5980,7 +5980,6 @@ static char_u *get_varp(vimoption_T *p) return (char_u *)&(curwin->w_p_cocu); case PV_COLE: return (char_u *)&(curwin->w_p_cole); - case PV_AI: return (char_u *)&(curbuf->b_p_ai); case PV_BIN: @@ -6019,6 +6018,8 @@ static char_u *get_varp(vimoption_T *p) return (char_u *)&(curbuf->b_p_cfu); case PV_OFU: return (char_u *)&(curbuf->b_p_ofu); + case PV_URF: + return (char_u *)&(curbuf->b_p_urf); case PV_EOL: return (char_u *)&(curbuf->b_p_eol); case PV_FIXEOL: @@ -6364,6 +6365,7 @@ void buf_copy_options(buf_T *buf, int flags) #endif buf->b_p_cfu = vim_strsave(p_cfu); buf->b_p_ofu = vim_strsave(p_ofu); + buf->b_p_urf = vim_strsave(p_urf); buf->b_p_tfu = vim_strsave(p_tfu); buf->b_p_sts = p_sts; buf->b_p_sts_nopaste = p_sts_nopaste; |