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

add keep-active-mark property to states #1821

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LemonBreezes
Copy link

This property is used to determine whether we should enter visual state when the mark is activated. This is useful for states like emacs state where we want to keep the mark active but not enter visual state. This change enables users to customize this behavior for their own states.

This addresses issue gridaphobe/evil-god-state#4 in evil-god-state.

This property is used to determine whether we should enter visual state
when the mark is activated. This is useful for states like emacs state
where we want to keep the mark active but not enter visual state. This
change enables users to customize this behavior for their own states.
@axelf4
Copy link
Collaborator

axelf4 commented Sep 2, 2023

I think the idea is sound but would be interested to hear what others think. The name keep-active-mark is a bit confusing - Visual state does not deactivate the mark.

The other solution I could think of which is cleaner but not 100% backward compatible is making the states themselves add the evil-visual-activate-hook hook when changed to.

@LemonBreezes
Copy link
Author

LemonBreezes commented Sep 2, 2023

I think the idea is sound but would be interested to hear what others think. The name keep-active-mark is a bit confusing - Visual state does not deactivate the mark.

The other solution I could think of which is cleaner but not 100% backward compatible is making the states themselves add the evil-visual-activate-hook hook when changed to.

I was thinking about this PR just now and I don't like how as a state property, it's meant to be immutable. Because I just realized that customizing the modes in evil-visual-activate-hook could also be used to make marking commands change the state from insert to visual. I've been experimenting with this combined with https://github.com/LemonBreezes/restore-point and I think that that combination of transiently entering visual state and restoring the point + insert state with <escape> feels very natural.

I think having the states add the hook themselves is easier to work with.

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