Permalink
Browse files

gh-110 Handle tabs in the caret line

  • Loading branch information...
Matthew O. Smith
Matthew O. Smith committed Jan 20, 2014
1 parent 6cdca82 commit 83bb083164fa55cef48783e7ab5c8d9486cdca0c
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/main/lisp/malabar-flycheck.el
@@ -30,11 +30,11 @@
(defun malabar-flycheck-error-column (lines)
- "Find the column of the error by looking for the magic caret"
+ "Find the column of the error by looking for the magic caret. Expand tabs to 8 spaces."
(let* ((caret-line (-first (lambda (s) (string-match "\\( *\\^\\).*" s)) lines))
- (g1 (match-string 1 caret-line))
- (g2 (replace-regexp-in-string "\t" " " g1)))
- (when caret-line (length g2))))
+ (g1 (when caret-line (match-string 1 caret-line)))
+ (g2 (when g1 (replace-regexp-in-string "\t" " " g1))))
+ (when g2 (length g2))))
(defun malabar-flycheck-error-line? (line)

0 comments on commit 83bb083

Please sign in to comment.