 (defsubst factor--looking-at-emptiness ()
   (looking-at "^[ \t]*$"))
 
+(defconst factor--regex-end-of-def-line
+  (format "^.*%s" factor--regex-definition-end))
+
 (defsubst factor--at-end-of-def ()
-  (or (looking-at factor--regex-definition-end)
+  (or (looking-at factor--regex-end-of-def-line)
       (looking-at factor--regex-single-liner)))
 
 (defun factor--at-setter-line ()

      (define-key m (vector '(control ?c) key) cmd)
      (define-key m (vector '(control ?c) `(control ,key)) cmd))))

(factor--define-key ?f 'factor-run-file)
(factor--define-key ?r 'factor-send-region)
(factor--define-key ?d 'factor-send-definition)

(defun factor--ppss-brackets-end ()
  (save-excursion
    (goto-char (factor--ppss-brackets-start))
    (condition-case nil
        (progn (forward-sexp)
               (1- (point)))
      (error -1)))))

(defsubst factor--indentation-at (pos)
  (save-excursion (goto-char pos) (current-indentation)))
