diff options
| author | Michael Kifer | 1999-12-04 06:19:05 +0000 |
|---|---|---|
| committer | Michael Kifer | 1999-12-04 06:19:05 +0000 |
| commit | b380fdf4554973cb981cb2460aa3691f00867186 (patch) | |
| tree | bbdc8dab3693e8cdb0704fea58f4075e33346b83 | |
| parent | 40afb9673dbd999797d96526297b202410fdf33d (diff) | |
| download | emacs-b380fdf4554973cb981cb2460aa3691f00867186.tar.gz emacs-b380fdf4554973cb981cb2460aa3691f00867186.zip | |
* viper-cmd.el (viper-change-state): Use
viper-ESC-moves-cursor-back to decide whether to move the cursor
back.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emulation/viper-cmd.el | 32 |
2 files changed, 23 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6c06499a374..daaa7a408d8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 1999-12-04 Michael Kifer <kifer@cs.sunysb.edu> | ||
| 2 | |||
| 3 | * viper-cmd.el (viper-change-state): Use | ||
| 4 | viper-ESC-moves-cursor-back to decide whether to move the cursor | ||
| 5 | back. | ||
| 6 | |||
| 1 | 1999-12-03 Kenichi Handa <handa@mule.m17n.org> | 7 | 1999-12-03 Kenichi Handa <handa@mule.m17n.org> |
| 2 | 8 | ||
| 3 | * international/mule-util.el (truncate-string-to-width): Docsting | 9 | * international/mule-util.el (truncate-string-to-width): Docsting |
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 78ed5e5d53c..90f17223ec3 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el | |||
| @@ -224,6 +224,22 @@ | |||
| 224 | (control n) (control p) (control f) (control b))) | 224 | (control n) (control p) (control f) (control b))) |
| 225 | (viper-restore-cursor-color 'after-replace-mode))) | 225 | (viper-restore-cursor-color 'after-replace-mode))) |
| 226 | 226 | ||
| 227 | |||
| 228 | ;; Make sure we don't delete more than needed. | ||
| 229 | ;; This is executed at viper-last-posn-in-replace-region | ||
| 230 | (defsubst viper-trim-replace-chars-to-delete-if-necessary () | ||
| 231 | (setq viper-replace-chars-to-delete | ||
| 232 | (max 0 | ||
| 233 | (min viper-replace-chars-to-delete | ||
| 234 | ;; Don't delete more than to the end of repl overlay | ||
| 235 | (viper-chars-in-region | ||
| 236 | (viper-replace-end) viper-last-posn-in-replace-region) | ||
| 237 | ;; point is viper-last-posn-in-replace-region now | ||
| 238 | ;; So, this limits deletion to the end of line | ||
| 239 | (viper-chars-in-region (point) (viper-line-pos 'end)) | ||
| 240 | )))) | ||
| 241 | |||
| 242 | |||
| 227 | (defun viper-replace-state-post-command-sentinel () | 243 | (defun viper-replace-state-post-command-sentinel () |
| 228 | ;; Restoring cursor color is needed despite | 244 | ;; Restoring cursor color is needed despite |
| 229 | ;; viper-replace-state-pre-command-sentinel: When one jumps to another buffer | 245 | ;; viper-replace-state-pre-command-sentinel: When one jumps to another buffer |
| @@ -316,7 +332,7 @@ | |||
| 316 | (viper-push-onto-ring viper-last-insertion | 332 | (viper-push-onto-ring viper-last-insertion |
| 317 | 'viper-insertion-ring)) | 333 | 'viper-insertion-ring)) |
| 318 | 334 | ||
| 319 | (if viper-ex-style-editing | 335 | (if viper-ESC-moves-cursor-back |
| 320 | (or (bolp) (backward-char 1)))) | 336 | (or (bolp) (backward-char 1)))) |
| 321 | )) | 337 | )) |
| 322 | 338 | ||
| @@ -2235,20 +2251,6 @@ problems." | |||
| 2235 | 2251 | ||
| 2236 | ))) | 2252 | ))) |
| 2237 | 2253 | ||
| 2238 | ;; Make sure we don't delete more than needed. | ||
| 2239 | ;; This is executed at viper-last-posn-in-replace-region | ||
| 2240 | (defsubst viper-trim-replace-chars-to-delete-if-necessary () | ||
| 2241 | (setq viper-replace-chars-to-delete | ||
| 2242 | (max 0 | ||
| 2243 | (min viper-replace-chars-to-delete | ||
| 2244 | ;; Don't delete more than to the end of repl overlay | ||
| 2245 | (viper-chars-in-region | ||
| 2246 | (viper-replace-end) viper-last-posn-in-replace-region) | ||
| 2247 | ;; point is viper-last-posn-in-replace-region now | ||
| 2248 | ;; So, this limits deletion to the end of line | ||
| 2249 | (viper-chars-in-region (point) (viper-line-pos 'end)) | ||
| 2250 | )))) | ||
| 2251 | |||
| 2252 | 2254 | ||
| 2253 | ;; Delete stuff between viper-last-posn-in-replace-region and the end of | 2255 | ;; Delete stuff between viper-last-posn-in-replace-region and the end of |
| 2254 | ;; viper-replace-overlay-marker, if viper-last-posn-in-replace-region is within | 2256 | ;; viper-replace-overlay-marker, if viper-last-posn-in-replace-region is within |