windwp / nvim-autopairs

autopairs for neovim written in lua

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`$` in fast wrap to always insert end pair at the end? (and a more flexible hint system idea)

bew opened this issue · comments

it is something I mentioned in #398, but was not covered by any discussion, re-posting here to trigger potential discussion

Is your feature request related to a problem? Please describe.
When I use fast wrap feature, using the end-of-line $ hint can have 2 different behavior based on the last char of the line:

  • if it matches the hint pattern, the plugin will ask if the end pair of fast wrap should be put before/after last char
  • if it does NOT match the pattern, the plugin will always put end par at the very end

Describe the solution you'd like
I like my tools to be easily deterministic, without too much guessing and differing behavior.
👉 I want that when I wrap to the end of line with $ hint, it always put the end pair at the very end, without asking to put it before/after the last char.
To that end, I think the $ hint should be after the last char to show it'll always put end pair at the very end.
If the line ends with a char matching the pattern there would be another hint for it, that allows to put the end pair before/after.

Even more flexibility could be offered by a function that returns hint data, and if the matching hint has multiple positions, show the 2nd layer of hint positioning, or just insert it directly otherwise.

Describe alternatives you've considered
Always second guessing myself and checking the last char, remembering the pattern and double checking what to do.

commented

I agree on some case you don't need to typing 2 key . PR is welcome 🤟

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

It's still in my radar 🙏

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

I don't use neovim as often (work + other priorities), but this is still definitely important..
Next time the stale bot comes I'll probably not comment again, but I'll definitely keep it in my radar of stuff I want to fix some day.