]> git.eshelyaron.com Git - emacs.git/commitdiff
Flymake correctly highlights whole last line if eob (bug#29201)
authorJoão Távora <joaotavora@gmail.com>
Thu, 9 Nov 2017 21:16:40 +0000 (21:16 +0000)
committerJoão Távora <joaotavora@gmail.com>
Thu, 9 Nov 2017 21:16:40 +0000 (21:16 +0000)
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

index 921ac9133093898f4c82cacdba90974dbc7fb5e3..883f96747b9b461711ddf8e7a56fbcdab763f2c0 100644 (file)
@@ -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))