From e109d7212111e677cec174042e3401312fb6995c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 11 Dec 2017 13:46:09 -0500 Subject: [PATCH] Fix hl-line mode bleeding into window in Emacs 26 --- core/core-ui.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/core-ui.el b/core/core-ui.el index 014f3dab8..47d3dca37 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -273,6 +273,16 @@ local value, whether or not it's permanent-local. Therefore, we cycle (setq hl-line-sticky-flag nil global-hl-line-sticky-flag nil) + ;; On Emacs 26+, when point is on the last line, hl-line highlights bleed into + ;; the rest of the window after eob. This is the fix. + (when (boundp 'display-line-numbers) + (defun doom--line-range () + (cons (line-beginning-position) + (if (save-excursion (forward-line) (eobp)) + (line-end-position) + (line-beginning-position 2)))) + (setq hl-line-range-function #'doom--line-range)) + (after! evil (defvar-local doom-buffer-hl-line-mode nil)