Permalink
Browse files

Fix hanging of `coffee-previous-indent` at start of buffer.

  • Loading branch information...
1 parent 03f75e3 commit d06361449c25068c68259582c84fd5070a45503e @superbobry superbobry committed with Mar 25, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 coffee-mode.el
View
@@ -457,8 +457,11 @@ For detail, see `comment-dwim'."
(save-excursion
(forward-line -1)
- (while (coffee-line-empty-p) (forward-line -1))
- (current-indentation)))
+ (if (bobp)
+ 0
+ (progn
+ (while (coffee-line-empty-p) (forward-line -1))
+ (current-indentation)))))
(defun coffee-line-empty-p ()
"Is this line empty? Returns non-nil if so, nil if not."

0 comments on commit d063614

Please sign in to comment.