Function: web-mode-attribute-kill

web-mode-attribute-kill is an interactive and natively compiled function defined in web-mode.el.

Signature

(web-mode-attribute-kill &optional ARG)

Documentation

Kill the current html attribute.

Key Bindings

web-mode-map C-c C-a k

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-attribute-kill (&optional arg)
  "Kill the current html attribute."
  (interactive "p")
  (unless arg (setq arg 1))
  (while (>= arg 1)
    (setq arg (1- arg))
    (web-mode-attribute-select)
    (when mark-active
      (let ((beg (region-beginning)) (end (region-end)))
        (save-excursion
          (goto-char end)
          (when (looking-at "[ \n\t]*")
            (setq end (+ end (length (match-string-no-properties 0)))))
          ) ;save-excursion
        (kill-region beg end)
        ) ;let
      ) ;when
    ) ;while
  ;; Delete a potential space before the closing ">".
  (when (and (looking-at ">")
             (looking-back " " (point-min)))
    (delete-char -1))
  )