Extraneous closing bracket when returning from normal mode
Hi,
Thanks for a great plugin! I am not sure if this is a bug or a feature, but when I write ( I get this output (|) as expected. And if I keep typing inside the brackets and then hit ) the cursor hops to after the closing bracket.
However: when I am inside the bracket and leave insert mode, then come back to insert mode and type ) I end up with )|).
Is there a way to avoid this?
I would like to avoid this aswell. :~)
It happened to me a few times when I did pasting via p
You can also do this trick. But I guess this is rather related to the wildtag matching.
-
<div<|ooops -
<div| -
<div>|</>
Hopping past the closer is a feature and is expected. I'm gonna make that more configurable in the future.
Now when leaving insert mode, all contexts of inserted pairs are removed. When entering insert mode again we can't hop past expanded pairs because we no longer know about ones. This is an intentional design decision. Pears doesn't keep track of existing pairs in the file, only ones entered during insert mode. Once it's left insert mode it doesn't care anymore. I've had to many issues with pair plugins trying to be to smart and move past characters when I didn't want it to. This is what drove this design decision.
Also, there may be some sort of way to do this in the future, but it is not high on the priority list.
Fair enough :-) If this is expected behavior I'll learn how to get used to it. I'd keep this issue open, though, in case you find a good way of configuring this.
@kflak I eventually want to make it an opt in feature at some point. I don't like it ;) but I know a lot of people probably would opt into it.
Currently I certainly would, but who knows, maybe a bit of forced weening would make me come to the dark side as well...
I'd like to see support for this as well. :smiley: Currently it's a bit tricky to use pears in combination with for example code completion, as navigating pmenu results require you to exit insert mode, thus resetting pears' state.