mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-30 17:01:02 -05:00
fix(evil): add error handling for :h[elp] ex command
apropos throws up an arith-error trying to rank the results of matchless regexp (which can result in a segfault on some systems; see #8532), and is *incredibly* slow lookuping up short queries, so the command will now abort if the query is just a regexp operator or less than 3 characters long. Fix: #8532
This commit is contained in:
@@ -182,6 +182,13 @@ non-nil, a search is preformed against Doom's manual (with
|
||||
(funcall (or (command-remapping #'describe-function)
|
||||
#'describe-function)
|
||||
(evil-ex-completed-binding (match-string 1 query))))
|
||||
((or (string-match "^ *[^a-z0-9-_]$" query)
|
||||
(condition-case nil
|
||||
(ignore (string-match-p query ""))
|
||||
(invalid-regexp t)))
|
||||
(user-error "Invalid query: %S" query))
|
||||
((< (string-width query) 3)
|
||||
(user-error "Query too short (must be > 2 characters): %S" query))
|
||||
((message "Searching for %S, this may take a while..." query)
|
||||
(apropos query t))))))
|
||||
|
||||
|
Reference in New Issue
Block a user