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

meow-select-on-[change|append|insert] changes where the mark goes #651

Open
Haxxflaxx opened this issue Oct 22, 2024 · 8 comments
Open

meow-select-on-[change|append|insert] changes where the mark goes #651

Haxxflaxx opened this issue Oct 22, 2024 · 8 comments

Comments

@Haxxflaxx
Copy link
Contributor

I was playing around a bit with the new select on insert functionality and was looking at activating the region after the fact, but I noticed the variable is in charge of actually setting the mark, not just activating the selection.

Would it be better if the mark is set regardless, then the variables decide if the selection should be left active or not?

Also maybe a meow-activate fallback for meow-reverse?

@DogLooksGood
Copy link
Collaborator

Do you mean in your case, the region is not activated after exit the INSERT state?

The expected behavior is when you leave INSERT state, there's a region from the point you start to current position.

@Haxxflaxx
Copy link
Contributor Author

The functionality works as expected when the variables are set. The thing that I'm thinking about is that when they are not set, the mark isn't moved so if I activate the mark after the fact, then the region is from wherever it was before to point.

If the functions were rewritten to always drop a mark where the insertion begun, then check the variables to see if the region should be active or not; the markring would look the same for both when the variables are t and nil.

An example: (kmacro "v t h i n g <return> a SPC t e x t SPC a f t e r SPC t h i n g <escape>")
meow-select-on-append t:
thing< text after thing|

meow-select-on-append nil:
<thing text after thing|

where < is mark and | is point.

@DogLooksGood
Copy link
Collaborator

So, the idea is to always have a mark where we enter the insert state. I think it's good, we should do it.

meow-activate is not required, we can use builtin exchange-point-and-mark. I don't know if we should set it as the default fallback behavior for meow-reverse, as it might take your cursor to a place quite far. But it makes logical sense.

@Haxxflaxx
Copy link
Contributor Author

True exchange-point-and-mark would maybe be the expected behavior as it would do the same thing, just also activate the region. The jumping away was the reason I was thinking, maybe we want one press to activate, then another to reverse.

I would probably need to try them out and live with them for a while to see if they're nice.

@Haxxflaxx
Copy link
Contributor Author

After about 30 sec of playing around with using exchange-point-and-mark as fallback, I agree that maybe it's not great default behavior. It interacts a bit weirdly with meow-cancel-selection (though I will probably keep it myself).

@DogLooksGood
Copy link
Collaborator

Need some thinking on how to achieve this.

@Haxxflaxx
Copy link
Contributor Author

After using exchange-point-and-mark further I think the weird behaviors come from how the mark is moved to not spam the mark-ring, but this is probably better discussed in its own issue, so I will leave that here.

I've been playing around with how to naively implement the mark moving with a disabled region and I realize that I have no clue how activate- and deactivate-mark works. If i put them in a function that does something, then the activate or deactivate does nothing. But if I put it in its own function that I run on its own, then it works as I expect.

I've read that there is some interaction between deactivate-mark variable and things that modify the buffer, but I haven't really gotten anywhere there either.

@DogLooksGood
Copy link
Collaborator

Yeah, there are some tricky parts.

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

No branches or pull requests

2 participants