[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit b9d97fa50e 095/301: Fix iedit-blank-occurrences brok
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit b9d97fa50e 095/301: Fix iedit-blank-occurrences broken with rectangles problem |
Date: |
Mon, 10 Jan 2022 22:58:53 -0500 (EST) |
branch: elpa/iedit
commit b9d97fa50ee96176021b0acbdd216cd39e853b97
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Fix iedit-blank-occurrences broken with rectangles problem
Fix iedit-blank-occurrences broken with rectangles problem
Add .bzrignore
---
.gitignore | 3 ++-
iedit-tests.el | 20 ++++++++++++++++++--
iedit.el | 11 +++++++++--
3 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/.gitignore b/.gitignore
index 7c5214cc21..180f445a72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
*.elc
-
+.bzr
+.bzrignore
diff --git a/iedit-tests.el b/iedit-tests.el
index f4fb33d1da..761c60cc4d 100755
--- a/iedit-tests.el
+++ b/iedit-tests.el
@@ -2,9 +2,9 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-03-05 17:25:42 Victor Ren>
+;; Time-stamp: <2012-07-09 11:01:56 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
-;; Version: 0.94
+;; Version: 0.97
;; X-URL: http://www.emacswiki.org/emacs/Iedit
;; This file is not part of GNU Emacs, but it is distributed under
@@ -289,6 +289,22 @@ foo"
(iedit-blank-occurrences)
(should (string= (buffer-string) " barfoo ")))))
+(ert-deftest iedit-blank-occurrences-rectangle-test ()
+ "Test functions deal with the whole occurrences"
+ (with-iedit-test-fixture
+"foo
+ foo barfoo foo"
+ (lambda ()
+ (iedit-mode) ; turn off iedit
+ (goto-char 2)
+ (set-mark-command nil)
+ (forward-char 1)
+ (forward-line 1)
+ (iedit-rectangle-mode)
+ (iedit-blank-occurrences)
+ (should (string= (buffer-string) "f o
+ oo barfoo foo")))))
+
(ert-deftest iedit-delete-occurrences-test ()
"Test functions deal with the whole occurrences"
(with-iedit-test-fixture
diff --git a/iedit.el b/iedit.el
index ba7c34b05a..bcfe4c0e06 100644
--- a/iedit.el
+++ b/iedit.el
@@ -2,7 +2,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-07-04 10:07:47 Victor Ren>
+;; Time-stamp: <2012-07-09 10:45:56 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -365,6 +365,7 @@ This is like `describe-bindings', but displays only Iedit
keys."
(or (assq 'iedit-mode minor-mode-map-alist)
(setq minor-mode-map-alist
(cons (cons 'iedit-mode iedit-mode-map) minor-mode-map-alist)))
+
;; Avoid to restore Iedit mode when restoring desktop
(add-to-list 'desktop-minor-mode-handlers
'(iedit-mode . nil))
@@ -896,8 +897,14 @@ This function preserves case."
"Replace occurrences with blank spaces."
(interactive "*")
(let* ((ov (car iedit-occurrences-overlays))
+ (offset (- (point) (overlay-start ov)))
(count (- (overlay-end ov) (overlay-start ov))))
- (iedit-replace-occurrences (make-string count 32))))
+ (iedit-apply-on-occurrences
+ (lambda (beg end )
+ (delete-region beg end)
+ (goto-char beg)
+ (insert-and-inherit (make-string count 32))))
+ (goto-char (+ (overlay-start ov) offset))))
(defun iedit-delete-occurrences()
"Delete occurrences."
- [nongnu] elpa/iedit ac2faa29d0 075/301: Add iedit-mode-defun and global key binding, (continued)
- [nongnu] elpa/iedit ac2faa29d0 075/301: Add iedit-mode-defun and global key binding, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 09c5063668 088/301: Merge pull request #10 from lewang/master, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 5ad28b5ea0 003/301: updates, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6e49225083 042/301: Add iedit-toggle-case-sensitive, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit a8cbb6838b 047/301: Add iedit-kill-rectangle to iedit-rect mode and adjust keymap help, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 16ed986c33 066/301: Update document, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f8c930f073 068/301: Add org markup, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6300ca95d0 084/301: Update document with "narrowing" information, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 641d062b1b 081/301: Update documents, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit ab4a3857e7 085/301: Adds a .gitignore file to avoid dirty submodules., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b9d97fa50e 095/301: Fix iedit-blank-occurrences broken with rectangles problem,
ELPA Syncer <=
- [nongnu] elpa/iedit e35530f45d 097/301: Fix conjointed overlays overlapped problem after modification, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 2bf67ff6c7 100/301: Merge changes in master and, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 84c02ea4b6 049/301: Fix toggle case-sensitive problem when occurrence is empty string., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b58ba728ef 059/301: Add global variables and functions to make it possible to reapply last iedit modification, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f334da3f57 098/301: Split iedit into three files: iedit.el, iedit-lib.el, iedit-rect.el, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d2684ee774 099/301: Remove duplicate definations, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 67ad83f7fc 192/301: Rewrite iedit-expand-by-a-line, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d1326bdef1 136/301: release.sh: New file., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d6c99fa91a 130/301: set `iedit-rectangle` to the actual rectangle corners, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f36e6fcf0d 143/301: Move iedit-apply-global-modification to iedit, ELPA Syncer, 2022/01/10