Function: web-mode-jsx-depth-beginning-position

web-mode-jsx-depth-beginning-position is an interactive and natively compiled function defined in web-mode.el.

Signature

(web-mode-jsx-depth-beginning-position &optional POS TARGET-DEPTH)

Key Bindings

This command is not in any keymaps.

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-jsx-depth-beginning-position (&optional pos target-depth)
  (interactive)
  (unless pos (setq pos (point)))
  (unless target-depth (setq target-depth (get-text-property pos 'jsx-depth)))
  (cond
    ((or (null target-depth) (bobp))
     (setq pos nil))
    ((and (get-text-property pos 'jsx-beg) (= target-depth (get-text-property pos 'jsx-depth)))
     )
    (t
     (let ((continue t) depth)
       (while continue
         (setq pos (previous-single-property-change pos 'jsx-depth))
         (cond
           ((or (null pos)
                (null (setq depth (get-text-property pos 'jsx-depth))))
            (setq continue nil
                  pos nil))
           ((and (get-text-property pos 'jsx-beg) (= target-depth depth))
            (setq continue nil))
           ) ;cond
         ) ;while
       ) ;let
     ) ;t
    ) ;cond
  ;;(message "beg: %S" pos)
  pos)