emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 86b6e91: Avoid assertion violations in calculating


From: Eli Zaretskii
Subject: [Emacs-diffs] master 86b6e91: Avoid assertion violations in calculating line-number width
Date: Fri, 26 Apr 2019 15:42:19 -0400 (EDT)

branch: master
commit 86b6e91091ba14edb4811427fec8fe194f6520d4
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Avoid assertion violations in calculating line-number width
    
    * src/indent.c (line_number_display_width): Don't use the
    window's start marker if it belongs to a different buffer.
    (Bug#35429)
---
 src/indent.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/indent.c b/src/indent.c
index 1d5d346..c76e6b7 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -1968,8 +1968,11 @@ line_number_display_width (struct window *w, int *width, 
int *pixel_width)
         outside the accessible region, in which case we widen the
         buffer temporarily.  It could even be beyond the buffer's end
         (Org mode's display of source code snippets is known to cause
-        that), in which case we just punt and start from point instead.  */
-      if (startpos.charpos > Z)
+        that) or belong to the wrong buffer, in which cases we just
+        punt and start from point instead.  */
+      if (startpos.charpos > Z
+         || !(BUFFERP (w->contents)
+              && XBUFFER (w->contents) == XMARKER (w->start)->buffer))
        SET_TEXT_POS (startpos, PT, PT_BYTE);
       if (startpos.charpos < BEGV || startpos.charpos > ZV)
        {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]