Function: diff-hl-stage-dwim

diff-hl-stage-dwim is an interactive and natively compiled function defined in diff-hl.el.

Signature

(diff-hl-stage-dwim &optional WITH-EDIT)

Documentation

Stage the current hunk or choose the hunks to stage.

When called with the prefix argument, invokes diff-hl-stage-some.

Key Bindings

diff-hl-command-map S diff-hl-mode-map C-x v S

Source Code

;; Defined in /nix/store/cfz56rl3lp066226i0bmmgiicls3gcq7-emacs-packages-deps/share/emacs/site-lisp/elpa/diff-hl-20261001.135/diff-hl.el
(defun diff-hl-stage-dwim (&optional with-edit)
  "Stage the current hunk or choose the hunks to stage.
When called with the prefix argument, invokes `diff-hl-stage-some'."
  (interactive "P")
  (if (or with-edit (region-active-p))
      (call-interactively #'diff-hl-stage-some)
    (call-interactively #'diff-hl-stage-current-hunk)))