General refactors & reformatting across the board

This commit is contained in:
Henrik Lissner 2020-05-15 01:44:53 -04:00
parent 4e28b48a3a
commit ea18c83c0a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
19 changed files with 123 additions and 110 deletions

View file

@ -137,8 +137,7 @@
"This disables the company-box scrollbar, because:
https://github.com/sebastiencs/company-box/issues/44"
:around #'company-box--update-scrollbar
(cl-letf (((symbol-function #'display-buffer-in-side-window)
(symbol-function #'ignore)))
(letf! ((#'display-buffer-in-side-window #'ignore))
(apply orig-fn args))))

View file

@ -178,7 +178,7 @@ If ARG (universal argument), open selection in other-window."
(user-error "%S doesn't support wgrep" caller)))))
;;;###autoload
(defun +ivy-yas-prompt (prompt choices &optional display-fn)
(defun +ivy-yas-prompt-fn (prompt choices &optional display-fn)
(yas-completing-prompt prompt choices display-fn #'ivy-completing-read))
;;;###autoload

View file

@ -88,7 +88,7 @@ results buffer.")
(setq +ivy--origin nil)))
(after! yasnippet
(add-hook 'yas-prompt-functions #'+ivy-yas-prompt))
(add-hook 'yas-prompt-functions #'+ivy-yas-prompt-fn))
(defadvice! +ivy--inhibit-completion-in-region-a (orig-fn &rest args)
"`ivy-completion-in-region' struggles with completing certain
@ -114,12 +114,12 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
(cadr (plist-get ivy-rich-display-transformers-list
'ivy-switch-buffer))))
;; Include variable value in `counsel-describe-variable'
;; Enahnce the appearance of a couple counsel commands
(plist-put! ivy-rich-display-transformers-list
'counsel-describe-variable
'(:columns
((counsel-describe-variable-transformer (:width 40)) ; the original transformer
(+ivy-rich-describe-variable-transformer (:width 50))
(+ivy-rich-describe-variable-transformer (:width 50)) ; display variable value
(ivy-rich-counsel-variable-docstring (:face font-lock-doc-face))))
'counsel-M-x
'(:columns
@ -139,10 +139,9 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
;; Highlight buffers differently based on whether they're in the same project
;; as the current project or not.
(let* ((plist (plist-get ivy-rich-display-transformers-list 'ivy-switch-buffer))
(switch-buffer-alist (assq 'ivy-rich-candidate (plist-get plist :columns))))
(when switch-buffer-alist
(setcar switch-buffer-alist '+ivy-rich-buffer-name)))
(when-let* ((plist (plist-get ivy-rich-display-transformers-list 'ivy-switch-buffer))
(switch-buffer-alist (assq 'ivy-rich-candidate (plist-get plist :columns))))
(setcar switch-buffer-alist '+ivy-rich-buffer-name))
(ivy-rich-mode +1))
@ -264,7 +263,8 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
(cl-destructuring-bind (find-program . args)
(cond ((executable-find doom-projectile-fd-binary)
(append (list doom-projectile-fd-binary
"--color=never" "-E" ".git" "--type" "file" "--type" "symlink" "--follow")
"--color=never" "-E" ".git"
"--type" "file" "--type" "symlink" "--follow")
(if IS-WINDOWS '("--path-separator=/"))))
((executable-find "rg")
(append (list "rg" "--files" "--follow" "--color=never" "--hidden" "--no-messages")
@ -282,8 +282,8 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
(let ((offset (if (member find-program (list "rg" doom-projectile-fd-binary)) 0 2))
files)
(while (< (point) (point-max))
(push (buffer-substring
(+ offset (line-beginning-position)) (line-end-position)) files)
(push (buffer-substring (+ offset (line-beginning-position)) (line-end-position))
files)
(forward-line 1))
(nreverse files)))))))