diff options
author | Daniel Kochmański <daniel@turtleware.eu> | 2024-09-17 13:57:35 +0200 |
---|---|---|
committer | Daniel Kochmański <daniel@turtleware.eu> | 2024-09-17 14:22:36 +0200 |
commit | d3316fc006f6e8049c58f11df9e0a4786e543fe6 (patch) | |
tree | 73ea20e99f595fd80130d7676d8137d789322c09 | |
parent | 5b558337a51b8eba1beccb1e6a147373c83153a1 (diff) |
drei: don't assume that displayed-lines-count is correct
Sometimes drei gets confused by itself with counting.
-rw-r--r-- | Libraries/Drei/drei-redisplay.lisp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Libraries/Drei/drei-redisplay.lisp b/Libraries/Drei/drei-redisplay.lisp index 405d61f8..20b94f6b 100644 --- a/Libraries/Drei/drei-redisplay.lisp +++ b/Libraries/Drei/drei-redisplay.lisp @@ -353,7 +353,9 @@ last line." error if there is no such line (note that even an empty buffer consists of a single line on display, as long as it has been redislayed at some point)." - (elt (displayed-lines view) (1- (displayed-lines-count view)))) + (let ((count (displayed-lines-count view))) + (when (plusp count) + (elt (displayed-lines view) (1- count))))) (defun ensure-line-stroke-information-size (line min-size) "Ensure that the array of strokes in `line' contains at least |