[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/iedit 6e6d4bc478 151/301: Merge branch 'master' of https:/
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/iedit 6e6d4bc478 151/301: Merge branch 'master' of https://github.com/mbneedham/iedit |
Date: |
Mon, 10 Jan 2022 22:58:58 -0500 (EST) |
branch: elpa/iedit
commit 6e6d4bc478bf8b8155456c53e6aba5dc0753521f
Merge: 22f4729ae9 95e7731a91
Author: Victor Ren <victorhge@gmail.com>
Commit: Victor Ren <victorhge@gmail.com>
Merge branch 'master' of https://github.com/mbneedham/iedit
---
iedit-lib.el | 30 ++++++++++++++++++------------
iedit.el | 21 ++++++++++++---------
2 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/iedit-lib.el b/iedit-lib.el
index bac0451a51..7697543c3d 100644
--- a/iedit-lib.el
+++ b/iedit-lib.el
@@ -519,14 +519,18 @@ value of `iedit-occurrence-context-lines' is used for
this time."
(save-excursion
(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)))
+ (let ((current-start (point)))
+ (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 current-start))
;; 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))
+ (let ((current-end (point)))
+ (forward-line context-lines)
+ (setq prev-occurrence-end (1+ (line-end-position)))
+ (goto-char current-end))
;; goto the beginning of next occurrence
(goto-char (next-single-char-property-change (point)
'iedit-occurrence-overlay-name)))
(if (< prev-occurrence-end (point-max))
@@ -765,12 +769,14 @@ This function is supposed to be called in overlay keymap."
(defun iedit-current-occurrence-string ()
"Return current occurrence string.
Return nil if occurrence string is empty string."
- (let* ((ov (or (iedit-find-current-occurrence-overlay)
- (car iedit-occurrences-overlays)))
- (beg (overlay-start ov))
- (end (overlay-end ov)))
- (if (and ov (/= beg end))
- (buffer-substring-no-properties beg end)
+ (let ((ov (or (iedit-find-current-occurrence-overlay)
+ (car iedit-occurrences-overlays))))
+ (if ov
+ (let ((beg (overlay-start ov))
+ (end (overlay-end ov)))
+ (if (and ov (/= beg end))
+ (buffer-substring-no-properties beg end)
+ nil))
nil)))
(defun iedit-occurrence-string-length ()
diff --git a/iedit.el b/iedit.el
index 7117ae1b82..d2aef7f43c 100644
--- a/iedit.el
+++ b/iedit.el
@@ -358,15 +358,18 @@ Keymap used within overlays:
(if (or isearch-regexp isearch-word)
nil
(setq iedit-initial-string-local isearch-string))
- (isearch-exit)
- (setq mark-active nil)
- (run-hooks 'deactivate-mark-hook)
- (iedit-start regexp (point-min) (point-max))
- ;; TODO: reconsider how to avoid the loop in iedit-same-length
- (if (iedit-same-length)
- nil
- (iedit-done)
- (message "Matches are not the same length.")))
+ (let ((iedit-case-sensitive (not isearch-case-fold-search)))
+ (isearch-exit)
+ (setq mark-active nil)
+ (run-hooks 'deactivate-mark-hook)
+ (iedit-start regexp (point-min) (point-max))
+ ;; TODO: reconsider how to avoid the loop in iedit-same-length
+ (cond ((not iedit-occurrences-overlays)
+ (message "No matches found")
+ (iedit-done))
+ ((not (iedit-same-length))
+ (message "Matches are not the same length.")
+ (iedit-done)))))
(defun iedit-start (occurrence-regexp beg end)
"Start Iedit mode for the `occurrence-regexp' in the current buffer."
- [nongnu] elpa/iedit c274e6423b 200/301: Quit iedit mode if the number of occurrence is zero, (continued)
- [nongnu] elpa/iedit c274e6423b 200/301: Quit iedit mode if the number of occurrence is zero, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 8c2316693a 198/301: Fix bug: C-u M-p does not work, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit c7abe595b4 159/301: Remove confusing messages "Locate the fist occurrence", ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 2fe78a5ec9 201/301: Remove two confusing options, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f707cce0b8 193/301: Remove the key binding to M-[, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit f9f87a0dd9 212/301: Add key bindings for iedit-quit, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b4c7e41049 209/301: More doc for iedit-switch-to-mc-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 18b99c1fb4 169/301: Fix compile warning and test case, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit bd3fd44691 173/301: Added the default value for iedit-replace-occurrences, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b73b977839 204/301: Merge branch 'default-occurrence', ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 6e6d4bc478 151/301: Merge branch 'master' of https://github.com/mbneedham/iedit,
ELPA Syncer <=
- [nongnu] elpa/iedit 06bdb68bbf 203/301: Add iedit-switch-to-mc-mode, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit b2bffd978c 184/301: Merge pull request #54 from Vifon/iedit-replace-occurences_default-case, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d2f08e8862 163/301: Provide functions to narrow around current-line, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 27dbbdda0b 162/301: Split iedit-occurrence-update into two functions, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 9a40f6fa36 205/301: check if mc present, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 97ad9d0600 254/301: removed downcasing the from-string in iedit-lib.el/iedit-replace-occurrences to allow case sensitivity., ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 7a3725cd04 267/301: Small optimizations, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit 42654ba7ed 266/301: iedit-rect.el: Don't set iedit-initial-string-local, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit d335d6842a 183/301: Check if the default keybinding of iedit-mode is taken, ELPA Syncer, 2022/01/10
- [nongnu] elpa/iedit e575cbf569 256/301: Allow adding a incremented number in each occurence, ELPA Syncer, 2022/01/10