Permalink
Browse files

Fix infinite loop problem in iedit-rect-mode

Also add a new test case
  • Loading branch information...
1 parent 79d0f4f commit c699e32fe1779297169ebc87b2de0b775a66d567 @victorhge committed Jan 31, 2013
Showing with 10 additions and 4 deletions.
  1. +2 −2 iedit-rect.el
  2. +8 −2 iedit-tests.el
View
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2013-01-18 17:24:41 Victor Ren>
+;; Time-stamp: <2013-01-31 23:57:54 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -126,7 +126,7 @@ Commands:
(point)))
iedit-occurrences-overlays)
(forward-line 1))
- until (> (point) end))))
+ until (>= (point) end))))
(setq iedit-rectangle (list beg end))
(setq iedit-rectangle-mode (propertize
(concat " Iedit-rect:" (number-to-string (length iedit-occurrences-overlays)))
View
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2013-01-19 22:18:17 Victor Ren>
+;; Time-stamp: <2013-02-01 00:10:47 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Version: 0.97
;; X-URL: http://www.emacswiki.org/emacs/Iedit
@@ -473,7 +473,13 @@ fob")))))
(forward-char 3)
(forward-line 3)
(call-interactively 'iedit-rectangle-mode)
- (should (equal (marker-position-list iedit-rectangle) '(1 19))))))
+ (should (equal (marker-position-list iedit-rectangle) '(1 19)))
+ (call-interactively 'iedit-rectangle-mode)
+ (goto-char (point-min))
+ (set-mark-command nil)
+ (goto-char (point-max))
+ (call-interactively 'iedit-rectangle-mode)
+ (should (equal (marker-position-list iedit-rectangle) '(1 33))))))
(ert-deftest iedit-kill-rectangle-error-test ()
(with-iedit-test-fixture

0 comments on commit c699e32

Please sign in to comment.