aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-05-18 22:53:53 +0100
committerSean Dewar <seandewar@users.noreply.github.com>2021-09-23 02:04:11 +0100
commitf9779facca2cb9c8115aa1cbdd2fb71d105b8ebf (patch)
tree8c8a1d9bcbb2069e090b01e7b9bdc207895793f0 /src/nvim/ops.c
parent74ddd14241af45b4b07028006db9099780b9fe6c (diff)
downloadrneovim-f9779facca2cb9c8115aa1cbdd2fb71d105b8ebf.tar.gz
rneovim-f9779facca2cb9c8115aa1cbdd2fb71d105b8ebf.tar.bz2
rneovim-f9779facca2cb9c8115aa1cbdd2fb71d105b8ebf.zip
vim-patch:8.2.0924: cannot save and restore a register properly
Problem: Cannot save and restore a register properly. Solution: Add getreginfo() and make setreg() accept a dictionary. (Andy Massimino, closes vim/vim#3370) https://github.com/vim/vim/commit/bb861e293e0170455184079fa537278754b07911 Cherry-pick eval.txt changes for getreginfo() from: https://github.com/vim/vim/commit/6aa57295cfbe8f21c15f0671e45fd53cf990d404 https://github.com/vim/vim/commit/207f009326c8f878defde0e594d7d9ed9860106e
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 12fb8439f1..15f63c3179 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -804,12 +804,6 @@ bool valid_yank_reg(int regname, bool writing)
return false;
}
-typedef enum {
- YREG_PASTE,
- YREG_YANK,
- YREG_PUT,
-} yreg_mode_t;
-
/// Return yankreg_T to use, according to the value of `regname`.
/// Cannot handle the '_' (black hole) register.
/// Must only be called with a valid register name!
@@ -3650,6 +3644,12 @@ int get_register_name(int num)
}
}
+/// @return the index of the register "" points to.
+int get_unname_register(void)
+{
+ return y_previous == NULL ? -1 : (int)(y_previous - &y_regs[0]);
+}
+
/*
* ":dis" and ":registers": Display the contents of the yank registers.
*/