mirror of
https://github.com/neovim/neovim.git
synced 2025-09-17 00:38:17 +00:00
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)bb861e293e
Cherry-pick eval.txt changes for getreginfo() from:6aa57295cf
207f009326
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user