From 535688a4181ae4052db354ce2b877507f11c9e66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Thu, 9 Nov 2017 21:16:40 +0000 Subject: [PATCH] Flymake correctly highlights whole last line if eob (bug#29201) If a line/column pair indicates an end-of-buffer position, flymake should behave like the case where the last line of the buffer is referenced without a column indication. This behavior is currently to highlight the whole last line. * lisp/progmodes/flymake.el (flymake-diag-region): Correct conditions of fallback to the fallback-eol local function. --- lisp/progmodes/flymake.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 921ac913309..883f96747b9 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -334,7 +334,8 @@ region is invalid." (end (or (and sexp-end (not (= sexp-end beg)) sexp-end) - (ignore-errors (goto-char (1+ beg))))) + (and (< (goto-char (1+ beg)) (point-max)) + (point)))) (safe-end (or end (fallback-eol beg)))) (cons (if end beg (fallback-bol)) -- 2.39.5