Skip to content

Commit

Permalink
Merge branch 'master' of github.com:victorhge/iedit
Browse files Browse the repository at this point in the history
  • Loading branch information
victorhge committed Apr 16, 2015
2 parents a55fcae + dbe9e44 commit b95c351
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions iedit-lib.el
Original file line number Diff line number Diff line change
Expand Up @@ -582,16 +582,20 @@ value of `iedit-occurrence-context-lines' is used for this time."
(iedit-barf-if-buffering)
(iedit-apply-on-occurrences 'downcase-region))

(defun iedit-replace-occurrences(to-string)
(defun iedit-replace-occurrences()
"Replace occurrences with STRING.
This function preserves case."
(interactive "*sReplace with: ")
(interactive "*")
(iedit-barf-if-buffering)
(let* ((ov (iedit-find-current-occurrence-overlay))
(offset (- (point) (overlay-start ov)))
(from-string (downcase (buffer-substring-no-properties
(overlay-start ov)
(overlay-end ov)))))
(overlay-end ov))))
(to-string (read-string "Replace with: "
nil nil
from-string
nil)))
(iedit-apply-on-occurrences
(lambda (beg end from-string to-string)
(goto-char beg)
Expand Down

0 comments on commit b95c351

Please sign in to comment.