#define DOSO_GVIMRC 2 // loading gvimrc file
// flags for read_viminfo() and children
-#define VIF_WANT_INFO 1 // load non-mark info
-#define VIF_WANT_MARKS 2 // load file marks
-#define VIF_FORCEIT 4 // overwrite info already read
-#define VIF_GET_OLDFILES 8 // load v:oldfiles
+#define VIF_WANT_INFO 1 // load non-mark info
+#define VIF_WANT_MARKS 2 // load file marks
+#define VIF_ONLY_CURBUF 4 // bail out after loading marks for curbuf
+#define VIF_FORCEIT 8 // overwrite info already read
+#define VIF_GET_OLDFILES 16 // load v:oldfiles
// flags for buf_freeall()
#define BFA_DEL 1 // buffer is going to be deleted
/*
* Handle marks in the viminfo file:
* fp_out != NULL: copy marks, in time order with buffers in "buflist".
- * fp_out == NULL && (flags & VIF_WANT_MARKS): read marks for curbuf only
+ * fp_out == NULL && (flags & VIF_WANT_MARKS): read marks for curbuf
+ * fp_out == NULL && (flags & VIF_ONLY_CURBUF): bail out after curbuf marks
* fp_out == NULL && (flags & VIF_GET_OLDFILES | VIF_FORCEIT): fill v:oldfiles
*/
static void
wp->w_changelistidx = curbuf->b_changelistlen;
}
#endif
- break;
+ if (flags & VIF_ONLY_CURBUF)
+ break;
}
}
{
if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0
&& curbuf->b_ffname != NULL)
- read_viminfo(NULL, VIF_WANT_MARKS);
+ read_viminfo(NULL, VIF_WANT_MARKS | VIF_ONLY_CURBUF);
// Always set b_marks_read; needed when 'viminfo' is changed to include
// the ' parameter after opening a buffer.
&& vir.vir_line[0] != '>')
;
- do_copy_marks = (flags &
- (VIF_WANT_MARKS | VIF_GET_OLDFILES | VIF_FORCEIT));
+ do_copy_marks = (flags & (VIF_WANT_MARKS | VIF_ONLY_CURBUF
+ | VIF_GET_OLDFILES | VIF_FORCEIT));
}
if (fp_out != NULL)