commit/XEmacs: kehoea: Don't return a Charbpos before visible region, start_with_line_at_pixpos()

[email protected]
Newsgroups gmane.emacs.xemacs.patches
Message-ID <[email protected]>
1 new commit in XEmacs:

https://bitbucket.org/xemacs/xemacs/commits/cfc6a8c144f1/
Changeset:   cfc6a8c144f1
User:        kehoea
Date:        2014-01-21 01:27:16
Summary:     Don't return a Charbpos before visible region, start_with_line_at_pixpos()

src/ChangeLog addition:

2014-01-21  Aidan Kehoe  <[email protected]>

	* redisplay.c (start_with_line_at_pixpos):
	Apply Julian Bradfield's change of
	[email protected] , never returning a
	Charbpos before the visible region. Thank you Julian!
Affected #:  2 files

diff -r 7277cf461612be80403c68d3368a5b3329210e3d -r cfc6a8c144f16b2598435cfb0aa8a2a48204c947 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2014-01-21  Aidan Kehoe  <[email protected]>
+
+	* redisplay.c (start_with_line_at_pixpos):
+	Apply Julian Bradfield's change of
+	[email protected] , never returning a
+	Charbpos before the visible region. Thank you Julian!
+
 2014-01-20  Aidan Kehoe  <[email protected]>
 
 	* fileio.c (Fcopy_file, Finsert_file_contents_internal):

diff -r 7277cf461612be80403c68d3368a5b3329210e3d -r cfc6a8c144f16b2598435cfb0aa8a2a48204c947 src/redisplay.c
--- a/src/redisplay.c
+++ b/src/redisplay.c
@@ -8287,12 +8287,15 @@
       if (pixheight < 0)
 	{
 	  w->line_cache_validation_override--;
-	  if (-pixheight > point_line_height)
-	    /* We can't make the target line cover pixpos, so put it
-	       above pixpos.  That way it will at least be visible. */
-	    return prev_pos;
-	  else
-	    return cur_pos;
+          /* I see no reason why cur_pos can't be before BEGV
+             here, so check for it. It's not clear to me whether
+             prev_pos could be before BEGV, so check that as well. */
+          if (-pixheight > point_line_height)
+            /* We can't make the target line cover pixpos, so put it
+               above pixpos.  That way it will at least be visible. */
+            return (prev_pos <= BUF_BEGV (b)) ? BUF_BEGV (b) : prev_pos;
+          else
+            return (cur_pos <= BUF_BEGV (b)) ? BUF_BEGV (b) : cur_pos;
 	}
 
       cur_elt--;

Repository URL: https://bitbucket.org/xemacs/xemacs/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.