Skip to content

Commit

Permalink
meow-command: fix meow-visit bug on empty input (#602)
Browse files Browse the repository at this point in the history
* fixed meow-visit bug

* new empty failed message

* fixed spacing

* fixed spacing

* replaced tabs by spaces

* removed extra lines

---------

meow-visit hangs when minibuffer input is empty. Adds a check for empty input in meow-visit and modifies the result message to indicate it was an empty search.

Co-authored-by: bunnyanon <[email protected]>
  • Loading branch information
bunnyanon and bunnyanon authored Jun 2, 2024
1 parent 99e08c9 commit 090f7a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions meow-command.el
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,7 @@ To search backward, use \\[negative-argument]."
(text (meow--prompt-symbol-and-words
(if arg "Visit backward: " "Visit: ")
(point-min) (point-max)))
(visit-point (meow--visit-point text reverse)))
(visit-point (if (string-empty-p text) nil (meow--visit-point text reverse))))
(if visit-point
(let* ((m (match-data))
(marker-beg (car m))
Expand All @@ -1409,7 +1409,7 @@ To search backward, use \\[negative-argument]."
(meow--ensure-visible)
(meow--highlight-regexp-in-buffer text)
(setq meow--dont-remove-overlay t))
(message "Visit: %s failed" text))))
(message "Visit: %s failed" (if (string-empty-p text) "<empty>" text)))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; THING
Expand Down

0 comments on commit 090f7a4

Please sign in to comment.