diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2014-04-19 01:36:51 +0200 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2014-04-19 01:36:51 +0200 |
commit | bba633792b813249a47dde828cbf84cdb946ba60 (patch) | |
tree | e320e5217ad3dc878e49fb86be7297a5cef60e5f /src/insdel.c | |
parent | f0496348d1b9b1f2fff9e4265f51cbdc77eb40dc (diff) | |
parent | 2a2e6726d1f7031d89fd6740e5b167476267f778 (diff) | |
download | emacs-bba633792b813249a47dde828cbf84cdb946ba60.tar.gz |
Merge from emacs-24; up to 2014-04-16T15:28:06Z!eggert@cs.ucla.edu
Diffstat (limited to 'src/insdel.c')
-rw-r--r-- | src/insdel.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/insdel.c b/src/insdel.c index 82896758a15..2894af75348 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1849,14 +1849,9 @@ invalidate_buffer_caches (struct buffer *buf, ptrdiff_t start, ptrdiff_t end) need to consider the caches of their base buffer. */ if (buf->base_buffer) buf = buf->base_buffer; - if (buf->newline_cache) - invalidate_region_cache (buf, - buf->newline_cache, - start - BUF_BEG (buf), BUF_Z (buf) - end); - if (buf->width_run_cache) - invalidate_region_cache (buf, - buf->width_run_cache, - start - BUF_BEG (buf), BUF_Z (buf) - end); + /* The bidi_paragraph_cache must be invalidated first, because doing + so might need to use the newline_cache (via find_newline_no_quit, + see below). */ if (buf->bidi_paragraph_cache) { if (start != end @@ -1880,13 +1875,20 @@ invalidate_buffer_caches (struct buffer *buf, ptrdiff_t start, ptrdiff_t end) &start_byte); set_buffer_internal (old); } - if (line_beg > BUF_BEG (buf)) - start = line_beg - 1; + start = line_beg - (line_beg > BUF_BEG (buf)); } invalidate_region_cache (buf, buf->bidi_paragraph_cache, start - BUF_BEG (buf), BUF_Z (buf) - end); } + if (buf->newline_cache) + invalidate_region_cache (buf, + buf->newline_cache, + start - BUF_BEG (buf), BUF_Z (buf) - end); + if (buf->width_run_cache) + invalidate_region_cache (buf, + buf->width_run_cache, + start - BUF_BEG (buf), BUF_Z (buf) - end); } /* These macros work with an argument named `preserve_ptr' |