Mercurial > vim
comparison src/option.c @ 3308:076003f52582 v7.3.421
updated for version 7.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.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 28 Jan 2012 18:03:35 +0100 |
parents | 320cc46d0eb0 |
children | de050fcc24cf |
comparison
equal
deleted
inserted
replaced
3307:54d621a3b561 | 3308:076003f52582 |
---|---|
7525 | 7525 |
7526 for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next) | 7526 for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next) |
7527 { | 7527 { |
7528 /* When 'undofile' is set globally: for every buffer, otherwise | 7528 /* When 'undofile' is set globally: for every buffer, otherwise |
7529 * only for the current buffer: Try to read in the undofile, if | 7529 * only for the current buffer: Try to read in the undofile, if |
7530 * one exists and the buffer wasn't changed. */ | 7530 * one exists and the buffer wasn't changed and the buffer was |
7531 * loaded. */ | |
7531 if ((curbuf == save_curbuf | 7532 if ((curbuf == save_curbuf |
7532 || (opt_flags & OPT_GLOBAL) || opt_flags == 0) | 7533 || (opt_flags & OPT_GLOBAL) || opt_flags == 0) |
7533 && !curbufIsChanged()) | 7534 && !curbufIsChanged() && curbuf->b_ml.ml_mfp != NULL) |
7534 { | 7535 { |
7535 u_compute_hash(hash); | 7536 u_compute_hash(hash); |
7536 u_read_undo(NULL, hash, curbuf->b_fname); | 7537 u_read_undo(NULL, hash, curbuf->b_fname); |
7537 } | 7538 } |
7538 } | 7539 } |