aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-08-22 10:02:32 -0600
committerJosh Rahm <rahm@google.com>2022-08-22 10:02:32 -0600
commitdeb60257f50dbcc72563df697236db48edbf914c (patch)
treea9c17c80d2dcf45fd809b4c95248f2e4d6a74e84 /src/nvim/ops.c
parent242f75745009b3a0a2108d98ce6c02b6e13aac3f (diff)
downloadrneovim-deb60257f50dbcc72563df697236db48edbf914c.tar.gz
rneovim-deb60257f50dbcc72563df697236db48edbf914c.tar.bz2
rneovim-deb60257f50dbcc72563df697236db48edbf914c.zip
feat(userregs): make the @" register call back into the userreg.
Before this changce, the userregs would not be repeated with @", now they can be. There is still the problem of repeating with a count does not call into the userreg, but that would be a lot of work to implement
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 889cc4f5bc..fe1496e2d4 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -995,6 +995,10 @@ yankreg_T *get_yank_register(int regname, int mode)
&& (regname == 0 || regname == '"' || regname == '*' || regname == '+')
&& y_previous != NULL) {
// in case clipboard not available, paste from previous used register
+ if (get_userreg(y_previous->name) != -1) {
+ // If y_previous is a userreg, repeat the userreg copy.
+ copy_userreg(y_previous, y_previous->name);
+ }
return y_previous;
}
@@ -3410,10 +3414,6 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags)
reg = get_yank_register(regname, YREG_PASTE);
}
- if (get_userreg(regname) != -1) {
- copy_userreg(reg, regname);
- }
-
y_type = reg->y_type;
y_width = reg->y_width;
y_size = reg->y_size;