Closed zdcthomas closed 1 year ago
See #153, as this is probably the exact same situation; I am now strongly preferring to revert the code.
Ahh, sorry I didn't catch that, yeah it looks identical. I could look into making it an option and by default preferring the standard, more predictable way?
Personally I've never been a big fan of jump ahead behaviors, so I might be biased.
I don't fully remember if I've commented my code properly, but the relevant portions are probably in motions.lua
, in particular wherever the is_quote
function is called. It's basically used to "jump ahead" whenever the character is a quote. However, it doesn't lend itself very well to extensibility (in particular, by the user) and is somewhat "hard-coded" in at the moment. I was originally thinking of just omitting the code altogether since it seems to be more confusing for people as a whole, and is an extra burden to maintain. If you're able to find some aesthetically pleasing way to abstract the functionality however, I'm all ears.
More complications: If the user decides to define a new surrounding pair that is different from the "trigger" character, then the process of moving the cursor to the beginning is non-trivial.
Ahh good point on that, that's definitely an extra level of complication.
Then yeah, I think I totally agree about taking it out. Ultimately it'll make things more predictable which I think is worth it
Closing this to centralize discussion in #153
Checklist
main
branch?:h nvim-surround
to see if there might be any relevant information there?To reproduce
In the buffer
and the minimal setup
Expected behavior
I would expect surround to target the pair of
'
actually surrounding the cursor.Based on the jumps section of the docs I would expect the opposite of this behavior.
Actual behavior
The cursor jumps to the final pair of
'
and deletes/changes them. I.Ekeystrokes:
ds'
buffer:Additional context
Thanks for the awesome plugin! super appreciate all the hard work!
I'd be super down to try to contribute a solution also, if someone could point me to roughly where to look!