(reposting, as this message did not show up yet)
Hi Bram,
this patch fixes this issue from the todo-list:
When setting 'undofile' while the file is already loaded, but
unchanged, try to read the undo file. Requires computing a checksum
of the text. (Andy Wokula)
regards,
Christian
--
Es ist nichts so allgemein, als falsche Worte in gutem Schein.
-- Sprichwort
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff --git a/src/option.c b/src/option.c
--- a/src/option.c
+++ b/src/option.c
@@ -7516,6 +7516,37 @@
compatible_set();
}
+#ifdef FEAT_PERSISTENT_UNDO
+ /* 'undofile' */
+ else if ((int *)varp == &curbuf->b_p_udf ||
+ (int *)varp == &p_udf)
+ {
+ buf_T *buf = curbuf;
+ char_u hash[UNDO_HASH_SIZE];
+
+ /* set or setglobal udf, iterate overall buffers
+ * and try to read in the undofile, if one exists */
+ if ((opt_flags & OPT_GLOBAL) || !opt_flags)
+ {
+ for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next){
+ if (!curbufIsChanged())
+ {
+ u_compute_hash(hash);
+ u_read_undo(NULL, hash, NULL);
+ }
+ }
+ }
+ else
+ /* setlocal udf, only check for current buffer */
+ if (!curbufIsChanged())
+ {
+ u_compute_hash(hash);
+ u_read_undo(NULL, hash, NULL);
+ }
+ curbuf = buf;
+ }
+#endif
+
/* 'list', 'number' */
else if ((int *)varp == &curwin->w_p_list
|| (int *)varp == &curwin->w_p_nu