Mercurial > vim
diff src/misc1.c @ 2189:cb94c42c0e1a v7.2.445
updated for version 7.2.445
Problem: Crash when using undo/redo and a FileChangedRO autocmd event that
reloads the buffer. (Dominique Pelle)
Solution: Do not allow autocommands while performing and undo or redo.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Wed, 07 Jul 2010 18:20:28 +0200 |
parents | 733f0dc510c3 |
children | 073ff46fe397 |
line wrap: on
line diff
--- a/src/misc1.c +++ b/src/misc1.c @@ -2467,10 +2467,12 @@ skip_to_option_part(p) } /* - * changed() is called when something in the current buffer is changed. + * Call this function when something in the current buffer is changed. * * Most often called through changed_bytes() and changed_lines(), which also * mark the area of the display to be redrawn. + * + * Careful: may trigger autocommands that reload the buffer. */ void changed() @@ -2536,6 +2538,7 @@ static void changed_common __ARGS((linen * - marks the windows on this buffer to be redisplayed * - marks the buffer changed by calling changed() * - invalidates cached values + * Careful: may trigger autocommands that reload the buffer. */ void changed_bytes(lnum, col) @@ -2649,6 +2652,7 @@ deleted_lines_mark(lnum, count) * below the changed lines (BEFORE the change). * When only inserting lines, "lnum" and "lnume" are equal. * Takes care of calling changed() and updating b_mod_*. + * Careful: may trigger autocommands that reload the buffer. */ void changed_lines(lnum, col, lnume, xtra) @@ -2716,6 +2720,11 @@ changed_lines_buf(buf, lnum, lnume, xtra } } +/* + * Common code for when a change is was made. + * See changed_lines() for the arguments. + * Careful: may trigger autocommands that reload the buffer. + */ static void changed_common(lnum, col, lnume, xtra) linenr_T lnum; @@ -2966,6 +2975,7 @@ check_status(buf) * Don't use emsg(), because it flushes the macro buffer. * If we have undone all changes b_changed will be FALSE, but "b_did_warn" * will be TRUE. + * Careful: may trigger autocommands that reload the buffer. */ void change_warning(col)