 (defun merlin-check-synchronize (&optional clean)
   "If merlin point is before the end of line send everything up to the end of line"
   (interactive)
-  (let ((p merlin-lock-point))
-    (if (> (point-at-eol) merlin-lock-point)
-        (merlin-update-point nil))))
+  (save-excursion
+    (previous-line 1)
+    (let ((p merlin-lock-point))
+      (if (> (point-at-eol) merlin-lock-point)
+          (merlin-update-point nil)))))
 
 (defun merlin-edit (start end length)
   (if (< start merlin-lock-point)
       (progn
-        (message "im coming in out of this rain")
         (setq merlin-lock-point (merlin-retract-to start))
         (merlin-update-overlay))))
 ;; COMPLETION

(defun merlin-type-enclosing ()
  "If there is a selected type enclosing, kill it. Otherwise start a new session at point"
  (interactive)
  (if (not merlin-enclosing-types)
      (let ((list
             (mapcar
              '(lambda (obj)
                 (cons
                  (cdr (assoc 'type obj))
                  (merlin-make-bounds obj)))
              (elt
               (merlin-is-return
                (merlin-send-command "type" (list "enclosing" (merlin-unmake-point (point)))))
               1))))
        (setq merlin-enclosing-types list)
        (setq merlin-enclosing-offset -1))
    (progn
      (setq merlin-enclosing-types nil)
      (setq merlin-enclosing-offset nil)
      (delete-overlay merlin-enclosing-overlay)
      (setq merlin-enclosing-overlay nil))))

(defun merlin-type-enclosing-go ()
  "Highlight the given corresponding enclosing data (of the form (type . bounds)"
  (let ((data (elt merlin-enclosing-types merlin-enclosing-offset)))
    (merlin-create-overlay 'merlin-enclosing-overlay (cdr data) 'next-error nil)
    (message "%s" (car data))))

(defun merlin-type-enclosing-go-up ()

            (process-send-eof (merlin-get-process))
            (delete-process (merlin-get-process))))
      (cancel-timer merlin-idle-timer)
      (if merlin-overlay (delete-overlay merlin-overlay))
      (if merlin-enclosing-overlay (delete-overlay merlin-enclosing-overlay))
      (merlin-delete-error-overlays)
      (if (get-buffer (merlin-make-buffer-name))
          (kill-buffer (merlin-make-buffer-name)))
