Skip to content

Commit

Permalink
Chosing register keeps eol anchoring in visual block state
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdl89 committed May 7, 2024
1 parent a8b28f5 commit 0b47905
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion evil-common.el
Original file line number Diff line number Diff line change
Expand Up @@ -2275,7 +2275,7 @@ be passed via ARGS."
;; ensure the start column is the left one.
(evil-sort startcol endcol)
;; maybe extend up to EOL
(when (and (memq last-command '(next-line previous-line))
(when (and (memq last-command '(next-line previous-line evil-use-register))
(eq temporary-goal-column most-positive-fixnum))
(goto-char startpt)
(while (< (point) endpt)
Expand Down
2 changes: 1 addition & 1 deletion evil-states.el
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ Reuse overlays where possible to prevent flicker."
(setq beg (progn (goto-char beg) (evil-move-to-column beg-col))
end (progn (goto-char end) (evil-move-to-column end-col 1))))
;; maybe extend end column to EOL
(and (memq this-command '(next-line previous-line))
(and (memq this-command '(next-line previous-line evil-use-register))
(eq temporary-goal-column most-positive-fixnum)
(setq end-col most-positive-fixnum))
;; force a redisplay so we can do reliable window
Expand Down
8 changes: 7 additions & 1 deletion evil-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -3245,7 +3245,13 @@ word3[]"))
(evil-test-buffer
"[a]lpha bravo charlie delta"
("vf \"xd" "dw" ";\"xp")
"charlie alpha delta")))
"charlie alpha delta"))
(ert-info ("Choosing register keeps eol anchoring")
(evil-test-buffer
"[a]aaaaa\nbbbbb\ncccc"
("\C-v" "2j" "$" "\"xy" "G" "o" [escape] "\"xp")
;; TODO will fail because it inserts a left col of spaces
"aaaaaa\nbbbbb\ncccc\n[a]aaaaa\nbbbbb\ncccc")))

(ert-deftest evil-test-last-insert-register ()
"Test last insertion register."
Expand Down

0 comments on commit 0b47905

Please sign in to comment.