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:
Sean Dewar
2021-05-18 22:53:53 +01:00
parent 74ddd14241
commit f9779facca
9 changed files with 226 additions and 18 deletions

View File

@@ -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.
*/