diff options
| author | Axel Forsman <axel@axelf.se> | 2023-01-03 11:53:38 +0100 |
|---|---|---|
| committer | Axel Forsman <axelsfor@gmail.com> | 2023-08-09 11:23:05 +0200 |
| commit | 26db9441a13ebedb2481d7ada4c3b5e60ec22795 (patch) | |
| tree | d533563038cf9896e57d84d68e137654f4cbf6b7 /evil-commands.el | |
| parent | 6e30037fdc6a275d78d6b82d89bd8e47bcf4d4e3 (diff) | |
Stop the '</'> and '[/'] marks from intertwining
The function evil-visual-paste would assign to evil-visual-point/-mark
the same markers used by the '[ and '] marks. Therefore, after a
single visual paste Normal mode "gv" would act funkily in that buffer
ever after. To reproduce:
* Enter a new buffer with the contents:
x
y
* With the cursor on "x", type "ylvpjxgv".
The expectation is that "x" should be re-selected. Instead the empty
lower line is selected due to it being the previously changed text.
This commit fixes this, and also removes unused definitions related to
evil-visual-previous-point/-mark.
Diffstat (limited to 'evil-commands.el')
| -rw-r--r-- | evil-commands.el | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/evil-commands.el b/evil-commands.el index 97598f3..8e4de2b 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -2407,10 +2407,8 @@ leave the cursor just after the new text." (when evil-kill-on-visual-paste (current-kill -1)) ;; Ensure that gv can restore visually pasted area... - (setq evil-visual-previous-mark evil-visual-mark - evil-visual-mark (evil-get-marker (if (< 0 dir) ?\[ ?\]) t) - evil-visual-previous-point evil-visual-point - evil-visual-point (evil-get-marker (if (< 0 dir) ?\] ?\[) t)) + (set-marker evil-visual-point (evil-get-marker (if (< dir 0) ?\[ ?\]) t)) + (set-marker evil-visual-mark (evil-get-marker (if (< dir 0) ?\] ?\[) t)) ;; mark the last paste as visual-paste (setq evil-last-paste (list (nth 0 evil-last-paste) |
