[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 64a7905949 138/301: Rewrite iedit-hide-unmatched-lin
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 64a7905949 138/301: Rewrite iedit-hide-unmatched-lines |
Date: |
Mon, 10 Jan 2022 22:58:57 -0500 (EST) |
branch: elpa/iedit
commit 64a7905949e7b4c0d45dc794dacba0031d6405db
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Rewrite iedit-hide-unmatched-lines
Do not depend on the order of iedit-occurrence-overlays
---
iedit-lib.el | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/iedit-lib.el b/iedit-lib.el
index 636c0bb3bc..e8d8c01fd7 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-10-17 08:48:28 Victor Ren>
+;; Time-stamp: <2012-12-07 23:16:43 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous rectangle refactoring
;; Version: 0.97
@@ -496,20 +496,22 @@ value of `iedit-occurrence-context-lines' is used for
this time."
(remove-overlays nil nil iedit-invisible-overlay-name t))
(defun iedit-hide-unmatched-lines (context-lines)
- "Hide unmatched lines using invisible overlay.
-This function depends on the order of `iedit-occurrences-overlays'. TODO"
+ "Hide unmatched lines using invisible overlay."
(let ((prev-occurrence-end 1)
(unmatched-lines nil))
(save-excursion
- (dolist (overlay iedit-occurrences-overlays)
- (goto-char (overlay-start overlay))
+ (iedit-first-occurrence)
+ (while (/= (point) (point-max))
(forward-line (- context-lines))
(let ((line-beginning (line-beginning-position)))
(if (> line-beginning prev-occurrence-end)
(push (list prev-occurrence-end (1- line-beginning))
unmatched-lines)))
- (goto-char (overlay-end overlay))
+ ;; goto the end of the occurrence
+ (goto-char (next-single-char-property-change (point)
'iedit-occurrence-overlay-name))
(forward-line context-lines)
- (setq prev-occurrence-end (line-end-position)))
+ (setq prev-occurrence-end (line-end-position))
+ ;; goto the beginning of next occurrence
+ (goto-char (next-single-char-property-change (point)
'iedit-occurrence-overlay-name)))
(if (< prev-occurrence-end (point-max))
(push (list prev-occurrence-end (point-max)) unmatched-lines))
(when unmatched-lines
@@ -593,12 +595,7 @@ be applied to other occurrences when buffering is off."
(setq iedit-buffering t)
(setq iedit-before-modification-string (iedit-current-occurrence-string))
(setq iedit-before-modification-undo-list buffer-undo-list)
- (message "Start buffering editing...")
- ;; (setq iedit-mode (propertize
- ;; (concat " Iedit-B:" (number-to-string (length
iedit-occurrences-overlays)))
- ;; 'face 'font-lock-warning-face))
- ;; (force-mode-line-update)
- )
+ (message "Start buffering editing..."))
(defun iedit-stop-buffering ()
"Stop buffering and apply the modification to other occurrences.
- [nongnu] elpa/iedit a5d117a75a 122/301: add test-case for deleting char at end of overlay with mirror at EOB, (continued)
- [nongnu] elpa/iedit a5d117a75a 122/301: add test-case for deleting char at end of overlay with mirror at EOB, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 78ac0ea958 105/301: Fix typo, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6f80f88134 106/301: Differentiate lib keymap and occurrence keymap, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 9cfd76f7c2 121/301: Toggle case-sensitive with intial region, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 106185cd95 187/301: Merge branch 'bmag-incremental-select', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 9d03d5d44e 186/301: Merge branch 'incremental-select', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit acb9fa54f3 152/301: Fix the testcase for iedit-hide-unmatched-lines, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6c6522c7e9 177/301: Minor bugfix: `help-char' need not be acceptable to `char-to-string'., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 4d50a08dd6 134/301: Add parameter back to iedit-mode-from-isearch, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d7d5931566 127/301: Fix the arguments for after-change-functions, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 64a7905949 138/301: Rewrite iedit-hide-unmatched-lines,
ELPA Syncer <=
- [nongnu] elpa/iedit bceb12e17b 139/301: Do not jump to the first occurrence after iedit-restrict-region, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 8eb9caaa94 132/301: use real buffer for testing to ease debugging, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 8149b66ce6 140/301: Read-only text handling, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 52a7ead70c 135/301: Fix comiler error for extra ")", ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 50748a5694 160/301: ensure iedit-skip-modification-once is t in case of errors, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 060b359afc 142/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 70e6d370fb 194/301: Merge branch 'master' of github.com:victorhge/iedit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 30db1d2ba1 191/301: Remove the key binding to M-[, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 3fae24471f 129/301: fix tests to call iedit-rectangle-mode interactively, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit dbe9e4478b 174/301: Merge pull request #41 from Vifon/iedit-replace-occurrences_default-value, ELPA Syncer, 2022/01/10