Slava Pestov 2009-06-14 18:03:32 -05:00
commit a5cd2202ff
1 changed files with 21 additions and 15 deletions

View File

@ -122,9 +122,15 @@ code in the buffer."
(beginning-of-line) (beginning-of-line)
(when (fuel-syntax--at-begin-of-def) 0))) (when (fuel-syntax--at-begin-of-def) 0)))
(defsubst factor-mode--previous-non-empty ()
(forward-line -1)
(while (and (not (bobp))
(fuel-syntax--looking-at-emptiness))
(forward-line -1)))
(defun factor-mode--indent-setter-line () (defun factor-mode--indent-setter-line ()
(when (fuel-syntax--at-setter-line) (when (fuel-syntax--at-setter-line)
(save-excursion (or (save-excursion
(let ((indent (and (fuel-syntax--at-constructor-line) (let ((indent (and (fuel-syntax--at-constructor-line)
(current-indentation)))) (current-indentation))))
(while (not (or indent (while (not (or indent
@ -134,14 +140,14 @@ code in the buffer."
(if (fuel-syntax--at-constructor-line) (if (fuel-syntax--at-constructor-line)
(setq indent (fuel-syntax--increased-indentation)) (setq indent (fuel-syntax--increased-indentation))
(forward-line -1))) (forward-line -1)))
indent)))) indent))
(save-excursion
(factor-mode--previous-non-empty)
(current-indentation)))))
(defun factor-mode--indent-continuation () (defun factor-mode--indent-continuation ()
(save-excursion (save-excursion
(forward-line -1) (factor-mode--previous-non-empty)
(while (and (not (bobp))
(fuel-syntax--looking-at-emptiness))
(forward-line -1))
(cond ((or (fuel-syntax--at-end-of-def) (cond ((or (fuel-syntax--at-end-of-def)
(fuel-syntax--at-setter-line)) (fuel-syntax--at-setter-line))
(fuel-syntax--decreased-indentation)) (fuel-syntax--decreased-indentation))