Function: web-mode-element-select

web-mode-element-select is an interactive and natively compiled function defined in web-mode.el.

Signature

(web-mode-element-select)

Documentation

Select the current html element (including opening and closing tags).

Key Bindings

web-mode-map C-c C-e s

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-element-select ()
  "Select the current html element (including opening and closing tags)."
  (interactive)
  (let* ((pos (point))
         (type (get-text-property pos 'tag-type)))
    (cond
      ((not type)
       (web-mode-element-parent)
       (unless (= (point) pos) (web-mode-element-select)))
      ((member type '(start void))
       (web-mode-tag-beginning)
       (set-mark (point))
       (web-mode-tag-match)
       (web-mode-tag-end)
       (exchange-point-and-mark))
      (t
       (web-mode-tag-match)
       (set-mark (point))
       (web-mode-tag-match)
       (web-mode-tag-end)
       (exchange-point-and-mark))
      )))