# HG changeset patch # User Michael Kifer # Date 944288345 0 # Node ID 8be2b52389a5beb288a2346b4c6ccc50a92b6bd5 # Parent cb2f5d1a71e4fd2d7d76e3476bd51d24f7d5f07f * viper-cmd.el (viper-change-state): Use viper-ESC-moves-cursor-back to decide whether to move the cursor back. diff -r cb2f5d1a71e4 -r 8be2b52389a5 lisp/ChangeLog --- a/lisp/ChangeLog Fri Dec 03 20:56:14 1999 +0000 +++ b/lisp/ChangeLog Sat Dec 04 06:19:05 1999 +0000 @@ -1,3 +1,9 @@ +1999-12-04 Michael Kifer + + * viper-cmd.el (viper-change-state): Use + viper-ESC-moves-cursor-back to decide whether to move the cursor + back. + 1999-12-03 Kenichi Handa * international/mule-util.el (truncate-string-to-width): Docsting diff -r cb2f5d1a71e4 -r 8be2b52389a5 lisp/emulation/viper-cmd.el --- a/lisp/emulation/viper-cmd.el Fri Dec 03 20:56:14 1999 +0000 +++ b/lisp/emulation/viper-cmd.el Sat Dec 04 06:19:05 1999 +0000 @@ -224,6 +224,22 @@ (control n) (control p) (control f) (control b))) (viper-restore-cursor-color 'after-replace-mode))) + +;; Make sure we don't delete more than needed. +;; This is executed at viper-last-posn-in-replace-region +(defsubst viper-trim-replace-chars-to-delete-if-necessary () + (setq viper-replace-chars-to-delete + (max 0 + (min viper-replace-chars-to-delete + ;; Don't delete more than to the end of repl overlay + (viper-chars-in-region + (viper-replace-end) viper-last-posn-in-replace-region) + ;; point is viper-last-posn-in-replace-region now + ;; So, this limits deletion to the end of line + (viper-chars-in-region (point) (viper-line-pos 'end)) + )))) + + (defun viper-replace-state-post-command-sentinel () ;; Restoring cursor color is needed despite ;; viper-replace-state-pre-command-sentinel: When one jumps to another buffer @@ -316,7 +332,7 @@ (viper-push-onto-ring viper-last-insertion 'viper-insertion-ring)) - (if viper-ex-style-editing + (if viper-ESC-moves-cursor-back (or (bolp) (backward-char 1)))) )) @@ -2235,20 +2251,6 @@ ))) -;; Make sure we don't delete more than needed. -;; This is executed at viper-last-posn-in-replace-region -(defsubst viper-trim-replace-chars-to-delete-if-necessary () - (setq viper-replace-chars-to-delete - (max 0 - (min viper-replace-chars-to-delete - ;; Don't delete more than to the end of repl overlay - (viper-chars-in-region - (viper-replace-end) viper-last-posn-in-replace-region) - ;; point is viper-last-posn-in-replace-region now - ;; So, this limits deletion to the end of line - (viper-chars-in-region (point) (viper-line-pos 'end)) - )))) - ;; Delete stuff between viper-last-posn-in-replace-region and the end of ;; viper-replace-overlay-marker, if viper-last-posn-in-replace-region is within