Function: web-mode-jsx-depth-next

web-mode-jsx-depth-next is a natively compiled function defined in web-mode.el.

Signature

(web-mode-jsx-depth-next REG-END)

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-next (reg-end)
  (let (beg end depth continue pos)
    (setq beg (point))
    ;;(message "pt=%S" beg)
    (unless (get-text-property beg 'jsx-beg)
      ;;(setq beg (next-single-property-change beg 'jsx-beg))
      ;;(setq pos (1+ beg))
      (setq pos (next-single-property-change (1+ beg) 'jsx-beg))
      (cond
        ((null pos)
         (setq beg nil))
        ((>= pos reg-end)
         (setq beg nil))
        (t
         (setq beg pos))
        ) ;cond
      ) ;unless
    ;;(message "beg=%S" beg)
    (when beg
      (setq depth (get-text-property beg 'jsx-beg)
            continue (not (null depth))
            pos beg)
      ;;(message "beg=%S" beg)
      (while continue
        (setq pos (next-single-property-change pos 'jsx-end))
        ;;(message "pos=%S" pos)
        (cond
          ((null pos)
           (setq continue nil))
          ((> pos reg-end)
           (setq continue nil))
          ((eq depth (get-text-property pos 'jsx-end))
           (setq continue nil
                 end pos))
          (t
           ;;(setq pos (1+ pos))
           )
          ) ;cond
        ) ;while
      ) ;when
    ;;(message "%S > %S" beg end)
    (if (and beg end) (cons beg end) nil)))