Skip to content

Commit

Permalink
bugfix for when there are no occurrences
Browse files Browse the repository at this point in the history
  • Loading branch information
mbneedham committed Jan 18, 2013
1 parent 232cd0e commit 95e7731
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions iedit-lib.el
Original file line number Diff line number Diff line change
Expand Up @@ -769,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 ()
Expand Down

0 comments on commit 95e7731

Please sign in to comment.