[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 83c037d678 156/301: Fix infinite loop problem in ied
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 83c037d678 156/301: Fix infinite loop problem in iedit-rect-mode |
Date: |
Mon, 10 Jan 2022 22:58:59 -0500 (EST) |
branch: elpa/iedit
commit 83c037d678956dde584b77bbca698e6a74cedbdb
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Fix infinite loop problem in iedit-rect-mode
Also add a new test case
---
iedit-rect.el | 33 ++++++++++++++++++---------------
iedit-tests.el | 10 ++++++++--
2 files changed, 26 insertions(+), 17 deletions(-)
diff --git a/iedit-rect.el b/iedit-rect.el
index 9a662079ca..83eae808d3 100644
--- a/iedit-rect.el
+++ b/iedit-rect.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2013-01-18 17:24:41 Victor Ren>
+;; Time-stamp: <2013-02-04 01:35:54 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -116,21 +116,24 @@ Commands:
(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))
- until (> (point) end))))
+ (while
+ (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)
+ (and (< (point) end) (forward-line 1))))))
(setq iedit-rectangle (list beg end))
- (setq iedit-rectangle-mode (propertize
- (concat " Iedit-rect:" (number-to-string (length
iedit-occurrences-overlays)))
- 'face 'font-lock-warning-face))
+ (setq iedit-rectangle-mode
+ (propertize
+ (concat " Iedit-rect:"
+ (number-to-string (length iedit-occurrences-overlays)))
+ 'face
+ 'font-lock-warning-face))
(force-mode-line-update)
(add-hook 'kbd-macro-termination-hook 'iedit-rectangle-done nil t)
(add-hook 'change-major-mode-hook 'iedit-rectangle-done nil t)
diff --git a/iedit-tests.el b/iedit-tests.el
index 12511f7955..046352b1e5 100644
--- a/iedit-tests.el
+++ b/iedit-tests.el
@@ -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
- [nongnu] elpa/iedit 962fcdb6cd 124/301: Fix failed test cases, (continued)
- [nongnu] elpa/iedit 962fcdb6cd 124/301: Fix failed test cases, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6d16d92a5a 112/301: replace iedit-occurrence-face with real face, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 57beb10db5 141/301: Remove all the dependency to the order of iedit-occurrences-overlays, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4efe511684 128/301: allow iedit-rectangle-mode to take beg end programatically, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit e48b52e353 185/301: Merge branch 'incremental-select' of git://github.com/bmag/iedit into bmag-incremental-select, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 668ea99c51 195/301: Allow prefix for expand functions, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 007a6f9c28 206/301: check if mc present, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7885f4beda 178/301: iedit-restrict-current-line resets expand state, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 79d0f4f3dc 155/301: Merge pull request #32 from mbneedham/master, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit df2de42fa1 149/301: Remove test-util.el, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 83c037d678 156/301: Fix infinite loop problem in iedit-rect-mode,
ELPA Syncer <=
- [nongnu] elpa/iedit b95c35107a 176/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 0d6193362d 144/301: Follow error convention, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c2763baaf6 168/301: Do not enable iedit from a failing isearch, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4e8b9453ac 261/301: Update occurrences in `post-command-hook', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 3c305620ae 250/301: Optimize iedit-mode-from-isearch, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 85fad4a3b7 233/301: Merge pull request #73 from lionel-/feature-mode-line, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit a7f5ed7cf9 257/301: Turn off iedit-mode at running `iedit-mode-toggle-on-function` twice, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 5050b7e88e 260/301: Fix a failed test case when Emacs is compiled without GUI, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit afca4e6bbf 213/301: Rename hook functions, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7ab2509231 225/301: Expand iedit-regexp-quote with passthrough, ELPA Syncer, 2022/01/10