fix(lib): doom/help-search-{load-path,loaded-files}

And updates them to reflect upstream changes to the consult--grep API.

Ref: c994e3ed59
This commit is contained in:
Henrik Lissner 2022-09-20 01:49:07 +02:00
parent c994e3ed59
commit 7a81b0252f
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -700,17 +700,28 @@ config blocks in your private config."
prompt
(lambda (input)
(pcase-let* ((cmd (split-string-and-unquote consult-ripgrep-args))
(type (consult--ripgrep-regexp-type (car cmd)))
(`(,arg . ,opts) (consult--command-split input))
(`(,re . ,hl) (funcall consult--regexp-compiler arg type)))
(when re
(list :command
(append cmd
(and (eq type 'pcre) '("-P"))
(list "-e" (consult--join-regexps re type))
opts
dirs)
:highlight hl))))
(`(,arg . ,opts) (consult--command-split query))
(flags (append cmd opts))
(ignore-case (if (or (member "-S" flags) (member "--smart-case" flags))
(let (case-fold-search)
;; Case insensitive if there are no uppercase letters
(not (string-match-p "[[:upper:]]" arg)))
(or (member "-i" flags) (member "--ignore-case" flags)))))
(if (or (member "-F" flags) (member "--fixed-strings" flags))
`(:command (,@cmd "-e" ,arg ,@opts ,@dirs) :highlight
,(apply-partially #'consult--highlight-regexps
(list (regexp-quote arg)) ignore-case))
(pcase-let* ((type (or consult--ripgrep-regexp-type
(setq consult--ripgrep-regexp-type
(if (consult--grep-lookahead-p (car cmd) "-P") 'pcre 'extended))))
(`(,re . ,hl) (funcall consult--regexp-compiler arg type ignore-case)))
(when re
`(:command
(,@cmd ,@(and (eq type 'pcre) '("-P"))
"-e" ,(consult--join-regexps re type)
,@opts
,@dirs)
:highlight ,hl))))))
data-directory query))
((fboundp 'counsel-rg)
(let ((counsel-rg-base-command