branch: elpa/evil commit ad3e95f6e3253ddf2d33377ebbff7c82082ab75a Author: Axel Forsman <a...@axelf.se> Commit: Axel Forsman <a...@axelf.se>
Fix g$ putting cursor on start of next visual line Normal mode "g$" put the cursor on the start of the next visual line instead of the end of the current one. Fixes #1244, fixes #1963 --- evil-commands.el | 3 ++- evil-common.el | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/evil-commands.el b/evil-commands.el index 0d0a1e85b7..9b350ee9db 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -176,7 +176,8 @@ If COUNT is given, move COUNT - 1 lines downward first." "Move the cursor to the last character of the current screen line. If COUNT is given, move COUNT - 1 screen lines downward first." :type inclusive - (end-of-visual-line count)) + (end-of-visual-line count) + (evil-move-cursor-back t)) (evil-define-motion evil-end-of-line-or-visual-line (count) "Move the cursor to the last character of the current screen diff --git a/evil-common.el b/evil-common.el index f7df526c45..aaeb8e1b72 100644 --- a/evil-common.el +++ b/evil-common.el @@ -1237,6 +1237,7 @@ If STATE is given it used a parsing state at point." ;; further, those motions move point to the beginning resp. the end of ;; the line (we never want point to leave its column). The code here ;; comes from simple.el, and I hope it will work in future. +(declare-function evil-end-of-visual-line "evil-commands") (defun evil-line-move (count &optional noerror) "Like `line-move' but conserves the column. Signal an error at buffer boundaries unless NOERROR is non-nil." @@ -1250,7 +1251,7 @@ Signal an error at buffer boundaries unless NOERROR is non-nil." (if (and line-move-visual (eq temporary-goal-column most-positive-fixnum) (memq last-command '(next-line previous-line))) - (let (temporary-goal-column) (end-of-visual-line (1+ count))) + (let (temporary-goal-column) (evil-end-of-visual-line (1+ count))) (condition-case err (line-move count) ((beginning-of-buffer end-of-buffer)