Closed telemachus closed 9 months ago
This would fix #41. In this version, multibyte pairs are only supported in insert mode. I have a more complex version that supports multibyte pairs in both insert and command mode. I've been using this since late September, and it's working well for me.
Sorry for the late reply. Is this supposed to work with the multichar paris? For example:
["**"] = { escape = false, close = true, pair = { "**", "**" } },
When I input **
, my cursor is at the wrong position: ***|*
because it only come back one character.
Sorry for the late reply. Is this supposed to work with the multichar paris?
No worries about delay. I did not include support for multi-character pairs. I only added support for single multibyte characters (like {"“", "”"}
).
For example:
["**"] = { escape = false, close = true, pair = { "**", "**" } },
When I input
**
, my cursor is at the wrong position:***|*
because it only come back one character.
Right. At the moment, this is working as designed. It may be possible to work with multi-character pairs, but it would be much more complicated. (The code to look for pairs would need to do more work to search for pairs that could be an arbitrary number of characters long. Also, think about such pairs across multiple lines: I'm not sure how the plugin could detect that, for example, ***
should be considered a closing pair because there was a previous ***
three lines ago.)
Here are the options I see.
Thanks for taking the time to consider this. Let me know what you'd like to do.
Thank you for the detailed options and your work on this issue. After considering them, I think the best approach is to stick with the first option - maintaining the current autoclose functionality. While the support for multibyte pairs is interesting, it seems to be a more specialized case and may not warrant a significant change right now.
Your contributions are definitely appreciated, and the idea itself has merit. If you're still interested in pursuing the multi-character function, I'd be open to reviewing a new PR on this in the future. Thanks again for your efforts!
{ "“", "”" }
for use in insert mode.BREAKING CHANGE:
pair
is now a two-item (list-like) table instead of a two-character string. Users will need to update custom configs.