Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix Emacs crashing bug when rectangle ends at EOB

  • Loading branch information...
commit f75e6fa73cf2f8c905e0b5a14d452d97d213375e 1 parent 79d0f4f
Le Wang authored
Showing with 15 additions and 10 deletions.
  1. +15 −10 iedit-rect.el
View
25 iedit-rect.el
@@ -112,20 +112,25 @@ Commands:
(setq iedit-occurrence-keymap iedit-rect-keymap)
(save-excursion
(let ((beg-col (progn (goto-char beg) (current-column)))
- (end-col (progn (goto-char end) (current-column))))
+ (end-col (progn (goto-char end) (current-column)))
+ (doit (lambda ()
+ (push (iedit-make-occurrence-overlay
+ (progn
+ (move-to-column beg-col t)
+ (point))
+ (progn
+ (move-to-column end-col t)
+ (point)))
+ iedit-occurrences-overlays)
+ (forward-line 1))))
(when (< end-col beg-col)
(rotatef beg-col end-col))
(goto-char beg)
(loop do (progn
- (push (iedit-make-occurrence-overlay
- (progn
- (move-to-column beg-col t)
- (point))
- (progn
- (move-to-column end-col t)
- (point)))
- iedit-occurrences-overlays)
- (forward-line 1))
+ (funcall doit)
+ (when (= (point) (point-max))
+ (funcall doit)
+ (return)))
until (> (point) end))))
(setq iedit-rectangle (list beg end))
(setq iedit-rectangle-mode (propertize
Please sign in to comment.
Something went wrong with that request. Please try again.