          (inhibit-modification-hooks t))
     (save-excursion
       (progn
-        (delete-region (string-to-number (nth 0 remove))
-                       (string-to-number (nth 1 remove)))
-        (goto-char (string-to-number (nth 0 where)))
+        (delete-region (kasumi-string-to-fix-point (nth 0 remove))
+                       (kasumi-string-to-fix-point (nth 1 remove)))
+
+
+        (goto-char (kasumi-string-to-fix-point (nth 0 where)))
+        (kasumi-add-diff (kasumi-string-to-fix-point (nth 0 remove))
+                         (- (kasumi-string-to-fix-point (nth 0 remove))
+                            (kasumi-string-to-fix-point (nth 1 remove))))
+
         (insert value)
-        (kasumi-put-idleflyline (string-to-number (nth 0 target))
-                                (string-to-number (nth 1 target)))))))
+        (kasumi-add-diff (kasumi-string-to-fix-point (nth 0 where))
+                         (length value))
+        (kasumi-put-idleflyline (kasumi-string-to-fix-point (nth 0 target))
+                                (kasumi-string-to-fix-point (nth 1 target)))))))
 
 (defun kasumi-send-load ()
   (interactive)

  (setq-local comment-start "#")
  (make-local-variable 'receive-in-progress)
  (make-local-variable 'receiving-str)
  (set (make-local-variable 'shiranui-process)
       (if (null kasumi-where-is-shiranui)
           (kasumi-start-shiranui (read-file-name "Shiranui Path:"))

(defun kasumi-refresh (beg end length)
  (progn
    (kasumi-remove-all-overlay)
    (setq point-diff '())
    (kasumi-send-load)))

;; http://www.emacswiki.org/emacs/ModeTutorial
