Function: yaml-compute-indentation

yaml-compute-indentation is a natively compiled function defined in yaml-mode.el.

Signature

(yaml-compute-indentation)

Documentation

Calculate the maximum sensible indentation for the current line.

Source Code

;; Defined in /nix/store/fxfawcfn8g3mqnf4q0lmvgvy0vp3nxrx-emacs-packages-deps/share/emacs/site-lisp/elpa/yaml-mode-20260830.2340/yaml-mode.el
;; Indentation and electric keys

(defun yaml-compute-indentation ()
  "Calculate the maximum sensible indentation for the current line."
  (save-excursion
    (beginning-of-line)
    (if (looking-at yaml-document-delimiter-re) 0
      (forward-line -1)
      (while (and (looking-at yaml-blank-line-re)
                  (> (point) (point-min)))
        (forward-line -1))
      (+ (current-indentation)
         (if (looking-at yaml-nested-map-re) yaml-indent-offset 0)
         (if (looking-at yaml-nested-sequence-re) yaml-indent-offset 0)
         (if (looking-at yaml-block-literal-re) yaml-indent-offset 0)))))