[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/on-screen cfc449d 1/2: [on-screen] Fix error for a corn
From: |
Stefan Monnier |
Subject: |
[elpa] externals/on-screen cfc449d 1/2: [on-screen] Fix error for a corner case |
Date: |
Fri, 27 Nov 2020 19:14:30 -0500 (EST) |
branch: externals/on-screen
commit cfc449d68e762cf05297bb923a48e9bbd0af1b92
Author: Michael Heerdegen <michael_heerdegen@web.de>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
[on-screen] Fix error for a corner case
Fix error when large parts of a buffer have been deleted, and bump
version to 1.3.3.
* packages/on-screen/on-screen.el (on-screen-after-scroll): Don't try
to count lines relative to former window-start when that position is
outside of current buffer bounds.
---
on-screen.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/on-screen.el b/on-screen.el
index e5c3977..755fcb9 100644
--- a/on-screen.el
+++ b/on-screen.el
@@ -7,7 +7,7 @@
;; Created: 24 Jan 2013
;; Keywords: convenience
;; URL: https://github.com/michael-heerdegen/on-screen.el
-;; Version: 1.3.2
+;; Version: 1.3.3
;; Package-Requires: ((cl-lib "0"))
@@ -526,7 +526,9 @@ This should normally go to `window-scroll-functions'."
((timerp timer)
(timer-set-time timer (timer-relative-time (current-time)
on-screen-delay)))
((or (not area)
- (= display-start s1)))
+ (= display-start s1)
+ ;; Deleting a large portion of the buffer caused window
scroll
+ (not (<= (point-min) s1 (point-max)))))
((and (numberp on-screen-drawing-threshold)
(< (abs (apply #'count-lines (sort (list display-start s1)
#'<)))
on-screen-drawing-threshold)))
@@ -551,7 +553,7 @@ This should normally go to `window-scroll-functions'."
;;scrolling down near buffer end
(setq s2 nil))
- (cond
+ (cond
((equal method '(shadow . nil))
(if (and s1 s2) (list (make-overlay s1 s2)) ()))
((eq (car method) 'shadow)