Skip to content
Snippets Groups Projects
Commit a77cb623 authored by ram's avatar ram
Browse files

Fixed WORTH-USING-INSERT-MODE so that it does the right thing. We must

pass in the number of characters saved by doing insertion so that
we can compare to that.
parent 729836f4
Branches
Tags
No related merge requests found
...@@ -784,7 +784,8 @@ ...@@ -784,7 +784,8 @@
hunk dl-len dl-pos))))) hunk dl-len dl-pos)))))
(t (t
(if (and (tty-device-insert-string device) (if (and (tty-device-insert-string device)
(worth-using-insert-mode device (- dindex sindex))) (worth-using-insert-mode device (- dindex sindex)
(- dl-len sindex)))
(funcall (tty-device-insert-string device) (funcall (tty-device-insert-string device)
hunk sindex dl-pos dl-chars sindex dindex) hunk sindex dl-pos dl-chars sindex dindex)
(funcall (tty-device-display-string device) (funcall (tty-device-display-string device)
...@@ -1043,7 +1044,7 @@ ...@@ -1043,7 +1044,7 @@
(setf (tty-device-cursor-x device) (setf (tty-device-cursor-x device)
(the fixnum (+ x (the fixnum (- end start))))))) (the fixnum (+ x (the fixnum (- end start)))))))
(defun worth-using-insert-mode (device insert-char-num) (defun worth-using-insert-mode (device insert-char-num chars-saved)
(let* ((init-string (tty-device-insert-init-string device)) (let* ((init-string (tty-device-insert-init-string device))
(char-init-string (tty-device-insert-char-init-string device)) (char-init-string (tty-device-insert-char-init-string device))
(char-end-string (tty-device-insert-char-end-string device)) (char-end-string (tty-device-insert-char-end-string device))
...@@ -1058,7 +1059,7 @@ ...@@ -1058,7 +1059,7 @@
char-end-string)) char-end-string))
0))))) 0)))))
(when end-string (incf cost (length (the simple-string end-string)))) (when end-string (incf cost (length (the simple-string end-string))))
(< cost insert-char-num))) (< cost chars-saved)))
(defun delete-char (hunk x y &optional (n 1)) (defun delete-char (hunk x y &optional (n 1))
(declare (fixnum x y n)) (declare (fixnum x y n))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment