[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/anzu 439e904931 155/288: Enable case-sensitive replacement
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/anzu 439e904931 155/288: Enable case-sensitive replacement for at cursor commands |
Date: |
Thu, 6 Jan 2022 03:58:48 -0500 (EST) |
branch: elpa/anzu
commit 439e90493192f37f1b375adc6f89a46e906ce03d
Author: Syohei YOSHIDA <syohex@gmail.com>
Commit: Syohei YOSHIDA <syohex@gmail.com>
Enable case-sensitive replacement for at cursor commands
---
anzu.el | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/anzu.el b/anzu.el
index 8bb86e618e..5eed20e732 100644
--- a/anzu.el
+++ b/anzu.el
@@ -322,7 +322,7 @@
;; Return highlighted count
(defun anzu--count-and-highlight-matched (buf str replace-beg replace-end
- use-regexp overlay-limit)
+ use-regexp overlay-limit
case-sensitive)
(anzu--cleanup-markers)
(when (not use-regexp)
(setq str (regexp-quote str)))
@@ -336,7 +336,9 @@
(let ((count 0)
(overlayed 0)
(finish nil)
- (case-fold-search (anzu--case-fold-search str)))
+ (case-fold-search (if case-sensitive
+ nil
+ (anzu--case-fold-search str))))
(while (and (not finish) (re-search-forward str replace-end t))
(cl-incf count)
(let ((beg (match-beginning 0))
@@ -359,14 +361,16 @@
(when (funcall searchfn input end t)
(setq anzu--outside-point (match-beginning 0))
(let ((overlay-limit (anzu--overlay-limit)))
- (anzu--count-and-highlight-matched buf input beg end use-regexp
overlay-limit))))))
+ (anzu--count-and-highlight-matched buf input beg end use-regexp
+ overlay-limit nil))))))
(defun anzu--check-minibuffer-input (buf beg end use-regexp overlay-limit)
(let* ((content (minibuffer-contents))
(empty-p (string= content ""))
(overlayed (if empty-p
(setq anzu--cached-count 0)
- (anzu--count-and-highlight-matched buf content beg end
use-regexp overlay-limit))))
+ (anzu--count-and-highlight-matched buf content beg end
use-regexp
+ overlay-limit nil))))
(when anzu--outside-point
(setq anzu--outside-point nil)
(with-selected-window (get-buffer-window buf)
@@ -538,7 +542,7 @@
(unless symbol
(error "No symbol at cursor!!"))
(let ((symbol-regexp (concat "\\_<" (regexp-quote symbol) "\\_>")))
- (anzu--count-and-highlight-matched buf symbol-regexp beg end t
overlay-limit)
+ (anzu--count-and-highlight-matched buf symbol-regexp beg end t
overlay-limit t)
(setq anzu--total-matched anzu--cached-count)
(force-mode-line-update)
symbol-regexp)))
@@ -642,11 +646,12 @@
(setq anzu--state 'replace anzu--current-position 0
anzu--replaced-markers (reverse anzu--replaced-markers)
clear-overlay t)
- (if use-regexp
- (apply 'perform-replace
(anzu--construct-perform-replace-arguments
- from to delimited beg end backward
query))
- (apply 'query-replace (anzu--construct-query-replace-arguments
- from to delimited beg end backward))))
+ (let ((case-fold-search (not at-cursor)))
+ (if use-regexp
+ (apply 'perform-replace
(anzu--construct-perform-replace-arguments
+ from to delimited beg end backward
query))
+ (apply 'query-replace (anzu--construct-query-replace-arguments
+ from to delimited beg end backward)))))
(progn
(unless clear-overlay
(anzu--clear-overlays curbuf beg end))
- [nongnu] elpa/anzu a1860f4c53 267/288: update url, copyright, and maintainer name, (continued)
- [nongnu] elpa/anzu a1860f4c53 267/288: update url, copyright, and maintainer name, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 896b2be2eb 281/288: Wordsmith the documentation re *-thing functions (#111), ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 33e4f13429 287/288: migrate tests from circleci to github actions, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 13dadaed10 284/288: update circleci to new docker images, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 14e4483a5e 286/288: Add ability to use lax whitespace (#119), ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 420f0c6894 137/288: Merge pull request #29 from bbatsov/patch-1, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu cb70e6c611 145/288: Fix wrong counting total matched number when used default input, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu b600df38cb 144/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ec0d1f5485 147/288: Merge pull request #33 from syohex/fix-replace-command-bugs, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu ab561fe896 151/288: Use symbol-value instead of eval-when-compile + defvar, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 439e904931 155/288: Enable case-sensitive replacement for at cursor commands,
ELPA Syncer <=
- [nongnu] elpa/anzu 686b264468 158/288: Refactoring: better getting migemo variable, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e664721a7f 157/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 137fc52ca2 159/288: Merge pull request #37 from syohex/improve-for-migemo, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu e782725f80 162/288: Support case sensitive highlighting, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu cf3370967b 170/288: Refactoring for evil-anzu, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 53db7f64b7 177/288: Reduce condition check, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu cb20bdcbfe 167/288: Merge pull request #40 from syohex/improve-replace-command, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu b723c16507 172/288: Bump up version and update Changes, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu db819bfb06 184/288: Merge pull request #47 from syohex/fix-46, ELPA Syncer, 2022/01/06
- [nongnu] elpa/anzu 4d81f2f0cd 192/288: Fix order of conditions in cond, ELPA Syncer, 2022/01/06