Skip to content

Commit 9c9248a

Browse files
committed
feat: Cache window-end
1 parent 68fc79b commit 9c9248a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

line-reminder.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ See macro `with-selected-window' description for arguments WINDOW and BODY."
208208

209209
(defun line-reminder--walk-window-lines (callback)
210210
"Walk through display window lines and execute CALLBACK on each line."
211-
(let ((wend (window-end nil t))
211+
(let ((wend (or (window-parameter nil 'window-end)
212+
(set-window-parameter nil 'window-end
213+
(window-end nil t))))
212214
(wstart (window-start))
213215
(line)
214216
(break))
@@ -584,6 +586,7 @@ and END."
584586

585587
(defun line-reminder--post-command ()
586588
"Post command."
589+
(set-window-parameter nil 'window-end nil)
587590
(line-reminder--render-post-command)
588591
(line-reminder--undo-post-command))
589592

0 commit comments

Comments
 (0)