summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2012-01-28 18:03:35 +0100
committerBram Moolenaar <Bram@vim.org>2012-01-28 18:03:35 +0100
commit3c70f33440ae141b09d0d2dec279a65a015bfef0 (patch)
tree57d6160ba0c729137d3390129f77d8dc98abfea5 /src/option.c
parent16c31fe1b710e415da676379a5e397afe8bbbd5b (diff)
downloadvim-git-3c70f33440ae141b09d0d2dec279a65a015bfef0.tar.gz
updated for version 7.3.421v7.3.421
Problem: Get E832 when setting 'undofile' in vimrc and there is a file to be edited on the command line. (Toothpik) Solution: Do not try reading the undo file for a file that wasn't loaded.
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/option.c b/src/option.c
index 60956d785..033a6d203 100644
--- a/src/option.c
+++ b/src/option.c
@@ -7527,10 +7527,11 @@ set_bool_option(opt_idx, varp, value, opt_flags)
{
/* When 'undofile' is set globally: for every buffer, otherwise
* only for the current buffer: Try to read in the undofile, if
- * one exists and the buffer wasn't changed. */
+ * one exists and the buffer wasn't changed and the buffer was
+ * loaded. */
if ((curbuf == save_curbuf
|| (opt_flags & OPT_GLOBAL) || opt_flags == 0)
- && !curbufIsChanged())
+ && !curbufIsChanged() && curbuf->b_ml.ml_mfp != NULL)
{
u_compute_hash(hash);
u_read_undo(NULL, hash, curbuf->b_fname);