Function: viper-window-middle

viper-window-middle is an interactive and byte-compiled function defined in viper-cmd.el.gz.

Signature

(viper-window-middle ARG)

Documentation

Go to middle window line.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/viper-cmd.el.gz
(defun viper-window-middle (arg)
  "Go to middle window line."
  (interactive "P")
  (let ((val (viper-p-val arg))
	(com (viper-getCom arg)))
    (if com (viper-move-marker-locally 'viper-com-point (point)))
    (push-mark nil t)
    (move-to-window-line (+ (/ (1- (window-height)) 2) (1- val)))

    ;; positioning is done twice: before and after command execution
    (if (and (eobp) (bolp) (not (bobp))) (forward-line -1))
    (back-to-indentation)

    (if com (viper-execute-com 'viper-window-middle val com))

    (if (and (eobp) (bolp) (not (bobp))) (forward-line -1))
    (back-to-indentation)
    ))