]> code.delx.au - gnu-emacs-elpa/commitdiff
Fix corner-case with thing-at-point
authorArtur Malabarba <bruce.connor.am@gmail.com>
Tue, 4 Nov 2014 23:18:22 +0000 (23:18 +0000)
committerArtur Malabarba <bruce.connor.am@gmail.com>
Tue, 4 Nov 2014 23:18:22 +0000 (23:18 +0000)
aggressive-indent.el

index 140cf2517fd0d432d1b316c93d85d5b1088cd8d7..c23122bfc7fa998ff8f744f3d27d01961774fc6e 100644 (file)
@@ -170,7 +170,7 @@ commands will NOT be followed by a re-indent."
     (region-active-p)
     buffer-read-only
     (null (buffer-modified-p))
-    (string-match "\\`[[:blank:]]*\n?\\'" (thing-at-point 'line))
+    (string-match "\\`[[:blank:]]*\n?\\'" (or (thing-at-point 'line) ""))
     (and (not aggressive-indent-comments-too)
          (aggressive-indent--in-comment-p))
     (aggressive-indent--in-string-p))