Function: indent-bars--extend-region

indent-bars--extend-region is a natively compiled function defined in indent-bars.el.

Signature

(indent-bars--extend-region START END)

Documentation

Extend the region START..END.

If indent-bars-display-on-blank-lines is non-nil, this extends it to include complete contiguous stretches of blank lines and always starts and ends on the beginning of a line.

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--extend-region (start end)
  "Extend the region START..END.
If `indent-bars-display-on-blank-lines' is non-nil, this extends
it to include complete contiguous stretches of blank lines and
always starts and ends on the beginning of a line."
  (save-excursion
    (let ((chars " \t\n"))
      (goto-char start)
      (forward-line 0)
      (when (and indent-bars-display-on-blank-lines
		 (< (skip-chars-backward chars) 0))
	(unless (bolp) (forward-line 1)))
      (when (< (point) start) (setq start (point)))
      (goto-char end)
      (unless (bolp) (forward-line 1))
      (when (and indent-bars-display-on-blank-lines
		 (> (skip-chars-forward chars) 0))
	(unless (bolp) (forward-line 0)))
      (when (> (point) end) (setq end (point)))))
  (cons start end))