aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-06-27 16:13:28 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-07-17 11:37:41 -0300
commitfba1d3b50f34a4e755bee8fa5dcc192efef202d8 (patch)
tree567fb53e58fa5bde20480b8be8a3937ae83d640f /src/nvim/normal.c
parent486c8e37c17e4aa89fa9ef7e0c682b659a5a8a82 (diff)
downloadrneovim-fba1d3b50f34a4e755bee8fa5dcc192efef202d8.tar.gz
rneovim-fba1d3b50f34a4e755bee8fa5dcc192efef202d8.tar.bz2
rneovim-fba1d3b50f34a4e755bee8fa5dcc192efef202d8.zip
provider: Add support for clipboard registers.
This reimplements the '+'/'*' clipboard registers(both are aliases to the same register, no dedicated storage for the X11 selection) on top of the provider infrastructure. This adds two new 'unnamedclip' option, has the same effect of setting 'clipboard' to 'unnamed/unnamedplus' in vim The 'clipboard' option was not reused because all values(except 'unnamedplus') seem to be useless for Neovim, and the code to parse the option was relatively big. The option remains for vim compatibility but it's silently ignored.
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index fc5073b177..5a4c3a326a 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -923,6 +923,7 @@ getcount:
/* Adjust the register according to 'clipboard', so that when
* "unnamed" is present it becomes '*' or '+' instead of '"'. */
+ adjust_clipboard_register(&regname);
set_reg_var(regname);
}
}
@@ -5101,6 +5102,7 @@ static void nv_brackets(cmdarg_T *cap)
end = equalpos(start, VIsual) ? curwin->w_cursor : VIsual;
curwin->w_cursor = (dir == BACKWARD ? start : end);
}
+ adjust_clipboard_register(&regname);
prep_redo_cmd(cap);
do_put(regname, dir, cap->count1, PUT_FIXINDENT);
if (was_visual) {
@@ -7267,9 +7269,10 @@ static void nv_put(cmdarg_T *cap)
*/
was_visual = TRUE;
regname = cap->oap->regname;
+ bool adjusted = adjust_clipboard_register(&regname);
if (regname == 0 || regname == '"'
|| VIM_ISDIGIT(regname) || regname == '-'
-
+ || adjusted
) {
/* The delete is going to overwrite the register we want to
* put, save it first. */