changeset 19732:d8478556c7f0

(operate-on-rectangle): If we overshoot when looking for endcol, back up.
author Richard M. Stallman <rms@gnu.org>
date Wed, 03 Sep 1997 21:09:39 +0000
parents 920d0a7b5930
children 59d864067cdb
files lisp/rect.el
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/rect.el	Wed Sep 03 20:52:13 1997 +0000
+++ b/lisp/rect.el	Wed Sep 03 21:09:39 1997 +0000
@@ -60,6 +60,10 @@
 	 (setq begextra (- (current-column) startcol))
 	 (setq startpos (point))
 	 (move-to-column endcol coerce-tabs)
+	 ;; If we overshot, move back one character
+	 ;; so that endextra will be positive.
+	 (if (and (not coerce-tabs) (> (current-column) endcol))
+	     (backward-char 1))
 	 (setq endextra (- endcol (current-column)))
 	 (if (< begextra 0)
 	     (setq endextra (+ endextra begextra)