mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 7.4.1925
Problem: Viminfo does not merge file marks properly. Solution: Use a timestamp. Add the :clearjumps command.
This commit is contained in:
@@ -1983,6 +1983,8 @@ write_viminfo(char_u *file, int forceit)
|
||||
*/
|
||||
if (*wp == 'a')
|
||||
{
|
||||
EMSG2(_("E929: Too many viminfo temp files, like %s!"),
|
||||
tempname);
|
||||
vim_free(tempname);
|
||||
tempname = NULL;
|
||||
break;
|
||||
@@ -2164,9 +2166,13 @@ do_viminfo(FILE *fp_in, FILE *fp_out, int flags)
|
||||
{
|
||||
if (flags & VIF_WANT_INFO)
|
||||
{
|
||||
/* Registers are read and newer ones are used when writing. */
|
||||
if (fp_out != NULL)
|
||||
{
|
||||
/* Registers and marks are read and kept separate from what
|
||||
* this Vim is using. They are merged when writing. */
|
||||
prepare_viminfo_registers();
|
||||
prepare_viminfo_marks();
|
||||
}
|
||||
|
||||
eof = read_viminfo_up_to_marks(&vir,
|
||||
flags & VIF_FORCEIT, fp_out != NULL);
|
||||
@@ -2200,6 +2206,7 @@ do_viminfo(FILE *fp_in, FILE *fp_out, int flags)
|
||||
write_viminfo_varlist(fp_out);
|
||||
#endif
|
||||
write_viminfo_filemarks(fp_out);
|
||||
finish_viminfo_marks();
|
||||
write_viminfo_bufferlist(fp_out);
|
||||
write_viminfo_barlines(&vir, fp_out);
|
||||
count = write_viminfo_marks(fp_out);
|
||||
@@ -2778,6 +2785,11 @@ read_viminfo_barline(vir_T *virp, int got_encoding, int force, int writing)
|
||||
handle_viminfo_register(&values, force);
|
||||
break;
|
||||
|
||||
case BARTYPE_MARK:
|
||||
barline_parse(virp, p, &values);
|
||||
handle_viminfo_mark(&values, force);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* copy unrecognized line (for future use) */
|
||||
if (writing)
|
||||
|
Reference in New Issue
Block a user