branch: master commit 6768214de442986ce380e9ac2f30ab115212cf63 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
ivy.el (ivy--insert-symbol-boundaries): Extract --- ivy.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ivy.el b/ivy.el index e97ac25..46f7856 100644 --- a/ivy.el +++ b/ivy.el @@ -1372,6 +1372,13 @@ Call the permanent action if possible." (move-end-of-line 1) (ivy--maybe-scroll-history)) +(defun ivy--insert-symbol-boundaries () + (undo-boundary) + (beginning-of-line) + (insert "\\_<") + (end-of-line) + (insert "\\_>")) + (defun ivy-next-history-element (arg) "Forward to `next-history-element' with ARG." (interactive "p") @@ -1385,11 +1392,7 @@ Call the permanent action if possible." (not (ffap-url-p ivy--default)) (not (ivy-state-dynamic-collection ivy-last)) (> (point) (minibuffer-prompt-end))) - (undo-boundary) - (insert "\\_>") - (goto-char (minibuffer-prompt-end)) - (insert "\\_<") - (forward-char (+ 2 (length ivy--default))))) + (ivy--insert-symbol-boundaries))) (next-history-element arg)) (ivy--cd-maybe) (move-end-of-line 1)