Function: indent-bars--set-current-depth-highlight

indent-bars--set-current-depth-highlight is a natively compiled function defined in indent-bars.el.

Signature

(indent-bars--set-current-depth-highlight DEPTH)

Documentation

Set current highlight to DEPTH.

Works by remapping the appropriate indent-bars[-tag]-N face for all styles in the indent-bars--styles list. DEPTH should be greater than or equal to zero (zero meaning: no highlight).

Source Code

;; Defined in /nix/store/zkcdcnmcj3605fj09x584bf58d85brax-emacs-packages-deps/share/emacs/site-lisp/elpa/indent-bars-1.0.1/indent-bars.el
(defun indent-bars--set-current-depth-highlight (depth)
  "Set current highlight to DEPTH.
Works by remapping the appropriate indent-bars[-tag]-N face for
all styles in the `indent-bars--styles' list.  DEPTH should be
greater than or equal to zero (zero meaning: no highlight)."
  (dolist (s indent-bars--styles)
    (when-let* ((c (alist-get (ibs/tag s) indent-bars--remaps))) ; out with the old
      (face-remap-remove-relative c))
    (when (> depth 0)
      (let* ((face (indent-bars--face s depth))
	     (hl-col (and (ibs/current-depth-palette s)
			  (indent-bars--get-color s depth 'highlight)))
	     (hl-bg (ibs/current-bg-color s)))
	(when (or hl-col hl-bg (ibs/current-stipple-face s))
	  (setf (alist-get (ibs/tag s) indent-bars--remaps)
		(face-remap-add-relative
		 face
		 `(,@(when hl-col `(:foreground ,hl-col))
		   ,@(when hl-bg `(:background ,hl-bg)))
		 (ibs/current-stipple-face s))))))))