Skip to content

Commit

Permalink
swiper.el (swiper-thing-at-point): Add
Browse files Browse the repository at this point in the history
  • Loading branch information
masasam authored and astoff committed Jan 1, 2021
1 parent 78a06c0 commit 68faade
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions swiper.el
Expand Up @@ -503,6 +503,15 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
(interactive)
(swiper--ivy (swiper--candidates) initial-input))

;;;###autoload
(defun swiper-thing-at-point ()
"`swiper' with `ivy-thing-at-point'."
(interactive)
(let ((thing (ivy-thing-at-point)))
(when (use-region-p)
(deactivate-mark))
(swiper thing)))

(defvar swiper--current-window-start nil
"Store `window-start' to restore it later.
This prevents a \"jumping\" behavior which occurs when variables
Expand Down

0 comments on commit 68faade

Please sign in to comment.