From daabd795082bb3fcee4d8606fc8fce4c8e963d1b Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 3 Sep 1997 21:09:39 +0000 Subject: [PATCH] (operate-on-rectangle): If we overshoot when looking for endcol, back up. --- lisp/rect.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/rect.el b/lisp/rect.el index d8e742ce6a1..2904f94687a 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -60,6 +60,10 @@ Point is at the end of the segment of this line within the rectangle." (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) -- 2.39.2