Function: web-mode-invalidate-region-beginning-position

web-mode-invalidate-region-beginning-position is a natively compiled function defined in web-mode.el.

Signature

(web-mode-invalidate-region-beginning-position POS)

Source Code

;; Defined in /nix/store/2qgnz1rp30nzfz6w0apx4kdm14if1bbs-emacs-packages-deps/share/emacs/site-lisp/elpa/web-mode-20260831.219/web-mode.el
(defun web-mode-invalidate-region-beginning-position (pos)
  (save-excursion
    (goto-char pos)

    (cond
      ((and (looking-at-p ">") ;#1151
            (looking-back "--" (point-min)))
       (search-backward "<!--" nil t))
      ((and (bolp) (not (bobp)))
       (backward-char))
      )

    (beginning-of-line)
    ;;(message "pos=%S point=%S %S" pos (point) (text-properties-at (point)))
    (setq pos (point-min))
    (let ((continue (not (bobp))))
      (while continue
        (cond
          ((bobp)
           (setq continue nil))
          ;; NOTE: Going back to the previous start tag is necessary
          ;; when inserting a part endtag (e.g. </script>).
          ;; Indeed, parts must be identified asap.
          ((and (progn (back-to-indentation) t)
                (get-text-property (point) 'tag-beg)
                (eq (get-text-property (point) 'tag-type) 'start))
           (setq pos (point)
                 continue nil))
          (t
           (forward-line -1))
          ) ;cond
        ) ;while
      ;;(message "pos=%S" pos)
      pos)))