           (slate-backward-whitespace)
           (cond ((bobp)         ;must be first statement in block or exp
                  (if (nth 1 state)        ;within a paren exp
-                     (setq indent-amount (+ (slate-current-column)
-                                            slate-indent-increment))
+                     (save-restriction
+                       (widen)
+                       (beginning-of-line)
+                       (slate-forward-whitespace)
+                       (setq indent-amount (+ (slate-current-column)
+                                              slate-indent-increment)))
                    ;; we're top level
                    (setq indent-amount slate-indent-increment)))
                 ((equal (nth 0 state) 0)  ;at top-level

      (when (looking-at "[A-Za-z][A-Za-z0-9]*:") ;indent for colon
        (let ((parse-sexp-ignore-comments t))
          (beginning-of-line)
          (slate-backward-whitespace)
          (unless (memq (preceding-char) '(?. ?| ?\[ ?\( ?\{))
            (setq is-keyword t)))))
      (setq indent-amount (slate-calculate-indent))

                                        slate-indent-increment)))))))
    (save-excursion
      (save-restriction
        (widen)
        (beginning-of-line)
        (skip-chars-forward " \t")
        (when (memq (following-char) '(?\} ?\) ?\]))
          (setq indent-amount (max 0 (- indent-amount slate-indent-increment))))
        (while (memq (following-char) '(?\} ?\) ?\]))
          (setq indent-amount (max 0 (- indent-amount slate-indent-increment)))
          (forward-char))))
    (when (= indent-amount 1) (setq indent-amount slate-indent-increment))
    indent-amount))

(defun slate-indent-line ()
