Skip to content

Commit

Permalink
Move linum-update-window inside condition for better performance
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorpogue committed Aug 1, 2022
1 parent 3dddce7 commit 9a0a547
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions topspace.el
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,9 @@ command is run in the described case above."
1 topspace--window-start-before-scroll)))
(setq total-lines (abs total-lines))
(set-window-start (selected-window) 1)
(topspace-set-height (- total-lines lines-already-scrolled))))
(when (and (bound-and-true-p linum-mode) (fboundp 'linum-update-window))
(linum-update-window (selected-window))))))
(topspace-set-height (- total-lines lines-already-scrolled)))
(when (and (bound-and-true-p linum-mode) (fboundp 'linum-update-window))
(linum-update-window (selected-window)))))))

(defun topspace--after-recenter (&optional line-offset redisplay)
"Recenter near the top of buffers by adding top space appropriately.
Expand Down

0 comments on commit 9a0a547

Please sign in to comment.