aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2014-04-17 10:24:40 +0300
committerEli Zaretskii2014-04-17 10:24:40 +0300
commitf76da67d4040ec3c766b7f4977341e142348cf60 (patch)
treee77ee1ab0452c1055f5fafd74e04f9a712de224c /src
parentb262bde327db2cd9b2f01f2d3ed946d0b188cb9d (diff)
downloademacs-f76da67d4040ec3c766b7f4977341e142348cf60.tar.gz
emacs-f76da67d4040ec3c766b7f4977341e142348cf60.zip
Fix bug #17269 with corruption of the newline cache.
src/insdel.c (invalidate_buffer_caches): Invalidate the bidi paragraph-start cache before the newline cache.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/insdel.c22
2 files changed, 17 insertions, 10 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 84760abd019..d0aa2e59e01 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12014-04-17 Eli Zaretskii <eliz@gnu.org>
2
3 * insdel.c (invalidate_buffer_caches): Invalidate the bidi
4 paragraph-start cache before the newline cache. (Bug#17269)
5
12014-04-16 Stefan Monnier <monnier@iro.umontreal.ca> 62014-04-16 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * window.c (save_window_save): Lookup window_point_insertion_type in 8 * window.c (save_window_save): Lookup window_point_insertion_type in
diff --git a/src/insdel.c b/src/insdel.c
index ea5f6301501..85526d46db1 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1857,14 +1857,9 @@ invalidate_buffer_caches (struct buffer *buf, ptrdiff_t start, ptrdiff_t end)
1857 need to consider the caches of their base buffer. */ 1857 need to consider the caches of their base buffer. */
1858 if (buf->base_buffer) 1858 if (buf->base_buffer)
1859 buf = buf->base_buffer; 1859 buf = buf->base_buffer;
1860 if (buf->newline_cache) 1860 /* The bidi_paragraph_cache must be invalidated first, because doing
1861 invalidate_region_cache (buf, 1861 so might need to use the newline_cache (via find_newline_no_quit,
1862 buf->newline_cache, 1862 see below). */
1863 start - BUF_BEG (buf), BUF_Z (buf) - end);
1864 if (buf->width_run_cache)
1865 invalidate_region_cache (buf,
1866 buf->width_run_cache,
1867 start - BUF_BEG (buf), BUF_Z (buf) - end);
1868 if (buf->bidi_paragraph_cache) 1863 if (buf->bidi_paragraph_cache)
1869 { 1864 {
1870 if (start != end 1865 if (start != end
@@ -1888,13 +1883,20 @@ invalidate_buffer_caches (struct buffer *buf, ptrdiff_t start, ptrdiff_t end)
1888 &start_byte); 1883 &start_byte);
1889 set_buffer_internal (old); 1884 set_buffer_internal (old);
1890 } 1885 }
1891 if (line_beg > BUF_BEG (buf)) 1886 start = line_beg - (line_beg > BUF_BEG (buf));
1892 start = line_beg - 1;
1893 } 1887 }
1894 invalidate_region_cache (buf, 1888 invalidate_region_cache (buf,
1895 buf->bidi_paragraph_cache, 1889 buf->bidi_paragraph_cache,
1896 start - BUF_BEG (buf), BUF_Z (buf) - end); 1890 start - BUF_BEG (buf), BUF_Z (buf) - end);
1897 } 1891 }
1892 if (buf->newline_cache)
1893 invalidate_region_cache (buf,
1894 buf->newline_cache,
1895 start - BUF_BEG (buf), BUF_Z (buf) - end);
1896 if (buf->width_run_cache)
1897 invalidate_region_cache (buf,
1898 buf->width_run_cache,
1899 start - BUF_BEG (buf), BUF_Z (buf) - end);
1898} 1900}
1899 1901
1900/* These macros work with an argument named `preserve_ptr' 1902/* These macros work with an argument named `preserve_ptr'