Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove evil--visual-eol-anchored #1892

Merged
merged 2 commits into from Apr 30, 2024

Conversation

axelf4
Copy link
Collaborator

@axelf4 axelf4 commented Apr 27, 2024

There already exists a method for sticking to EOL: Setting temporary-goal-column to most-positive-fixnum. As such, there is no need for the variable evil--visual-eol-anchored introduced by commit e31bff8.

@tomdl89 I cannot replicate evil-test-end-of-visual-line in Vim, what motivated its addition? I have removed it here.

@tomdl89
Copy link
Member

tomdl89 commented Apr 27, 2024

Hi @axelf4 I'm away for a bit but will review in a few days. Please don't merge until I take a look. Cheers

evil-maps.el Outdated Show resolved Hide resolved
@tomdl89
Copy link
Member

tomdl89 commented Apr 27, 2024

I've had a quick look and agree that that test doesn't seem to correspond to behaviour in vim. I could have sworn I did test it against vim. Apart from my comment about g-up above, I think I'd rather merge this now as it does seem like something worth reversing. Then I can try to work out what I was thinking later! Cheers

There already exists a method for sticking to EOL: Setting
temporary-goal-column to most-positive-fixnum. As such, there is no
need for the variable evil--visual-eol-anchored introduced by commit
e31bff8.

This commit also fixes a regression where "g$" made "gj"/"gk" stick to
visual EOLs.
@tomdl89
Copy link
Member

tomdl89 commented Apr 27, 2024

Ah, had more of a look. I actually think what I implemented is how it should be (because if $ means "end of logical line regardless of what col that is, so persist this when moving logically", it makes sense to me that g$ would mean "end of visual line regardless of what visual col that is, so persist this when moving visually") rather than how vim actually does things. But alas the aim of evil is to emulate vim, despite how I think things should be. Weird that my conviction that it should be that way managed to blind me to how things are. Thanks for spotting!

@axelf4
Copy link
Collaborator Author

axelf4 commented Apr 27, 2024

Maybe a suggestion for an advice like

(define-advice evil-end-of-visual-line (:after (&rest _))
  (setq temporary-goal-column most-positive-fixnum
        this-command 'next-line))

could be added to the documentation? (Makes g$ anchor both j/k and gj/gk to EOL, but that is symmetric with $.)

@axelf4 axelf4 merged commit 55f29f0 into emacs-evil:master Apr 30, 2024
6 checks passed
@axelf4 axelf4 deleted the tmp-goal-col-visual-eol branch April 30, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants