Function: vi-shift-op

vi-shift-op is a byte-compiled function defined in vi.el.gz.

Signature

(vi-shift-op MOTION-COMMAND ARG AMOUNT)

Documentation

Perform shift command on range specified by MOTION-COMMAND with ARG for AMOUNT on each line. Negative amount means shift left. SPECIAL FEATURE: char argument can be used to specify shift amount(1-9).

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/vi.el.gz
(defun vi-shift-op (motion-command arg amount)
  "Perform shift command on range specified by MOTION-COMMAND with ARG for
AMOUNT on each line.  Negative amount means shift left.
SPECIAL FEATURE: char argument can be used to specify shift amount(1-9)."
  (let* ((range (vi-effective-range motion-command arg))
	 (begin (car range)) (end (cdr range)))
    (if (= begin end)
	nil				; point not moved, abort op
      (if (vi-prefix-char-value arg)
	  (setq amount (if (> amount 0)
			   (- (vi-prefix-char-value arg) ?0)
			 (- ?0 (vi-prefix-char-value arg)))))
      (indent-rigidly begin end amount)
      t)))