branch: master commit b3ca8860ecc8f52bbc30f432f56bd7a863814415 Author: Oleh Krehel <ohwoeo...@gmail.com> Commit: Oleh Krehel <ohwoeo...@gmail.com>
counsel.el (counsel--generic): Improve --- counsel.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/counsel.el b/counsel.el index c531367..e6a2bad 100644 --- a/counsel.el +++ b/counsel.el @@ -250,11 +250,10 @@ Update the minibuffer with the amount of lines collected every (declare-function cider-sync-request:complete "ext:cider-client") (defun counsel--generic (completion-fn) "Complete thing at point with COMPLETION-FN." - (let* ((bnd (bounds-of-thing-at-point 'symbol)) - (str (if bnd - (buffer-substring-no-properties - (car bnd) (cdr bnd)) - "")) + (let* ((bnd (or (bounds-of-thing-at-point 'symbol) + (cons (point) (point)))) + (str (buffer-substring-no-properties + (car bnd) (cdr bnd))) (candidates (funcall completion-fn str)) (ivy-height 7) (res (ivy-read (format "pattern (%s): " str)