evil
evil copied to clipboard
add keep-active-mark property to states
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 https://github.com/gridaphobe/evil-god-state/issues/4 in evil-god-state.
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 think the idea is sound but would be interested to hear what others think. The name
keep-active-markis 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-hookhook 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.