dev: merge branch 'master' of github.com:doomemacs
This commit is contained in:
commit
cd6d8c02b1
2 changed files with 48 additions and 24 deletions
|
@ -52,12 +52,6 @@
|
|||
;; quickly self-correct.
|
||||
(setq fast-but-imprecise-scrolling t)
|
||||
|
||||
;; Don't ping things that look like domain names.
|
||||
(setq ffap-machine-p-known 'reject)
|
||||
|
||||
;; Emacs "updates" its ui more often than it needs to, so slow it down slightly
|
||||
(setq idle-update-delay 1.0) ; default is 0.5
|
||||
|
||||
;; Font compacting can be terribly expensive, especially for rendering icon
|
||||
;; fonts on Windows. Whether disabling it has a notable affect on Linux and Mac
|
||||
;; hasn't been determined, but do it anyway, just in case. This increases memory
|
||||
|
|
|
@ -20,11 +20,26 @@ be enabled. If any function returns non-nil, the mode will not be activated."
|
|||
(unless (run-hook-with-args-until-success '+indent-guides-inhibit-functions)
|
||||
(indent-bars-mode +1)))
|
||||
:config
|
||||
;; Bitmap performance is inconsistent across display systems (pgtk, ns, mac,
|
||||
;; gtk, etc). There's also a bitmap init bug in PGTK builds of Emacs before
|
||||
;; v30 that could cause crashes (see jdtsmith/indent-bars#3). If you use PGTK
|
||||
;; and reverse this setting, you've been warned!
|
||||
(setq indent-bars-prefer-character t)
|
||||
(setq indent-bars-prefer-character
|
||||
(or
|
||||
;; Bitmaps are far slower on MacOS, inexplicably, but this needs more
|
||||
;; testing to see if it's specific to ns or emacs-mac builds, or is
|
||||
;; just a general MacOS issue.
|
||||
(featurep :system 'macos)
|
||||
;; FIX: A bitmap init bug in PGTK builds of Emacs before v30 that could
|
||||
;; cause crashes (see jdtsmith/indent-bars#3).
|
||||
(and (featurep 'pgtk)
|
||||
(< emacs-major-version 30)))
|
||||
|
||||
;; Show indent guides starting from the first column.
|
||||
indent-bars-starting-column 0
|
||||
;; Make indent guides subtle; the default is too distractingly colorful.
|
||||
indent-bars-width-frac 0.15 ; make bitmaps thinner
|
||||
indent-bars-color-by-depth nil
|
||||
indent-bars-color '(font-lock-comment-face :face-bg nil :blend 0.425)
|
||||
;; Don't highlight current level indentation; it's distracting and is
|
||||
;; unnecessary overhead for little benefit.
|
||||
indent-bars-highlight-current-depth nil)
|
||||
|
||||
;; TODO: Uncomment once we support treesit
|
||||
;; (setq indent-bars-treesit-support (modulep! :tools tree-sitter))
|
||||
|
@ -47,16 +62,31 @@ be enabled. If any function returns non-nil, the mode will not be activated."
|
|||
(defun +indent-guides-in-childframe-p ()
|
||||
(frame-parameter nil 'parent-frame)))
|
||||
|
||||
;; HACK: Out of the box, indent-bars offers no way to fully disable
|
||||
;; "highlighting the current line", so I advise on in, since the feature is
|
||||
;; unnecessary work (and allocation of timers) for users that don't want it,
|
||||
;; and for our performance-leaning defaults.
|
||||
(setq indent-bars-depth-update-delay nil)
|
||||
(defadvice! +indent-guides--disable-highlight-current-line-a (fn &rest args)
|
||||
:around #'indent-bars-setup
|
||||
(letf! (defun indent-bars--highlight-current-depth ()
|
||||
(when indent-bars-depth-update-delay
|
||||
(funcall indent-bars--highlight-current-depth)))
|
||||
(prog1 (apply fn args)
|
||||
(unless indent-bars-depth-update-delay
|
||||
(remove-hook 'post-command-hook #'indent-bars--highlight-current-depth t))))))
|
||||
;; HACK: `indent-bars-mode' interactions with some packages poorly. This
|
||||
;; section is dedicated to package interop fixes.
|
||||
(when (modulep! :tools magit)
|
||||
(after! magit-blame
|
||||
(add-to-list 'magit-blame-disable-modes 'indent-bars-mode)))
|
||||
|
||||
(when (modulep! :tools lsp)
|
||||
;; HACK: lsp-ui-peek uses overlays, and indent-bars doesn't know how to deal
|
||||
;; with all the whitespace it uses to format its popups, spamming it with
|
||||
;; indent guides. Making the two work together is a project for another
|
||||
;; day, so disable `indent-bars-mode' while its active instead. Doesn't
|
||||
;; affect character bars though.
|
||||
;; REVIEW: Report this upstream to `indent-bars'?
|
||||
(defadvice! +indent-guides--remove-after-lsp-ui-peek-a (&rest _)
|
||||
:after #'lsp-ui-peek--peek-new
|
||||
(when (and indent-bars-mode
|
||||
(not indent-bars-prefer-character)
|
||||
(overlayp lsp-ui-peek--overlay))
|
||||
(save-excursion
|
||||
(let ((indent-bars--display-function #'ignore)
|
||||
(indent-bars--display-blank-lines-function #'ignore))
|
||||
(indent-bars--fontify (overlay-start lsp-ui-peek--overlay)
|
||||
(1+ (overlay-end lsp-ui-peek--overlay))
|
||||
nil)))))
|
||||
(defadvice! +indent-guides--restore-after-lsp-ui-peek-a (&rest _)
|
||||
:after #'lsp-ui-peek--peek-hide
|
||||
(unless indent-bars-prefer-character
|
||||
(indent-bars-setup)))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue