patch 8.2.2039: viminfo is not written when creating a new file
Problem: Viminfo is not written when creating a new file.
Solution: Set "b_marks_read" in the new buffer. (Christian Brabandt,
closes #7350)
diff --git a/src/bufwrite.c b/src/bufwrite.c
index 4b52246..d9f85a3 100644
--- a/src/bufwrite.c
+++ b/src/bufwrite.c
@@ -2579,6 +2579,12 @@
#endif
}
+#ifdef FEAT_VIMINFO
+ // Make sure marks will be written out to the viminfo file later, even when
+ // the file is new.
+ curbuf->b_marks_read = TRUE;
+#endif
+
got_int |= prev_got_int;
return retval;