"Go down count lines, try to keep at the same column."
(interactive "p")
(setq this-command 'next-line) ; this is a needed trick
- (if (= (point) (or (line-move count) (point)))
+ (if (= (point) (progn (line-move count) (point)))
(ding) ; no moving, already at end of buffer
(setq last-command 'next-line)))
(defun vi-previous-line-first-nonwhite (count)
"Go up COUNT lines. Stop at first non-white."
(interactive "p")
- (previous-line count)
+ (forward-line (- count))
(back-to-indentation))
(defun vi-scroll-up-window (count)
(setq end (1+ end)))
((eq moving-unit 'line)
(goto-char begin) (beginning-of-line) (setq begin (point))
- (goto-char end) (next-line 1) (beginning-of-line) (setq end (point))))
+ (goto-char end) (forward-line 1) (beginning-of-line) (setq end (point))))
(if (> end (point-max)) (setq end (point-max))) ; force in buffer region
(cons begin end)))))
(t (error "Register %c is not containing text string" reg))))
(if (vi-string-end-with-nl-p put-text) ; put back text as lines
(if after-p
- (progn (next-line 1) (beginning-of-line))
+ (progn (forward-line 1) (beginning-of-line))
(beginning-of-line))
(if after-p (forward-char 1)))
(push-mark (point))
(setq char (read-char))
(vi-ask-for-info char))))
+(declare-function c-mark-function "cc-cmds" ())
+
(defun vi-mark-region (arg region)
"Mark region appropriately. The next char REGION is d(efun),s(-exp),b(uffer),
p(aragraph), P(age), f(unction in C/Pascal etc.), w(ord), e(nd of sentence),