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

How is g:AutoPairsShortcutMultilineClose and the new multiline close system working out? #32

Closed
LunarWatcher opened this issue Apr 24, 2021 · 9 comments
Labels
enhancement New feature or request status:In progress

Comments

@LunarWatcher
Copy link
Owner

Some concerns were raised regarding g:AutoPairsShortcutMultilineClose and potentially the now separate multiline closure system.

For anyone out of the loop on the general subject, multiline close was moved out and into a separate keybind because it's substantially easier and less prone to false positives. In a way, it's fly mode light mode, but without the ability to revert. Internally, it joins empty lines into a space, and considers the first close character on the first non-empty line as a part of the "match". As outlined in #21, this creates balancing problems.

Just to cover all bases here, the options are:

  • Back insert - this would make the entire functionality resemble fly mode, except for fly mode including text when searching
  • Outsourcing into an explicit function call (the option I went with; possibly not the best implementation): makes it periodically usable, doesn't obstruct general pair insertion. Essentially a weak opt-in flymode
  • Nuke the entire feature (probable candidate if the general feedback is that it has no place in anyone's workflow)
  • ... potentially something else?

These won't work:

  • Add a modifier to the pair (keyboard layouts, terminal input processing, blah blah) for multiline
  • File-wide balance checks to make multiline checks feasible - this option is not feasible due to the implementation. Language semantics and structures mean it's extremely complex to parse just any file and have it work. Doing this would be an entire project on its own

So for the feedback bit:

For those of you using (or trying to use it), is it working out so far? And in general (open question to anyone who feels like it), any comments on the implementation? I'm not expecting a full code review of course, I largely mean in terms of usage (or potentially lack thereof).

What about the keybind? Alternatives are welcome as long as it doesn't conflict with terminal input processing and/or keyboard layouts.

Entirely alternate implementation ideas are also welcome - everything can be changed if needed, so if the feature isn't working out for most people in its current form, it can be changed.

@LunarWatcher LunarWatcher added enhancement New feature or request help wanted Extra attention is needed type:Feedback wanted labels Apr 24, 2021
@StarfishC
Copy link

StarfishC commented May 6, 2021

Maybe It's better to use let g:AutoPairsMultilineClose = 1 or 0 ....

@LunarWatcher
Copy link
Owner Author

LunarWatcher commented Jun 11, 2021

I was really hoping for more feedback, but since I guess it isn't coming, I'll be reverting the change I made, and make an attempt at making it less awkward to use. Might still keep the changes I made as an alternative, but we'll see.

Adding a separate option to toggle it would essentially make that system redundant as well. I'll revisit the implementation details tomorrow, when I'm more awake than I am right now :')

@StarfishC
Copy link

How can I set default: Enabled multiline close and 'Disabled multiline close' throw g:AutoPairsShortcutToggleMultilineClose when I need?

@LunarWatcher
Copy link
Owner Author

I don't understand what you mean -- can't trigger a crash when clicking the keybind defined in g:AutoPairsShortcutToggleMultilineClose or find any other obvious errors related to it

@LunarWatcher
Copy link
Owner Author

Unless you mean that, for whatever reason, "Enabled multiline close" and "Disabled multiline close" are thrown as errors instead of being printed as information, in which case, I need your vim specs (no repro in 8.2 1-3013)

@StarfishC
Copy link

I want to the default behavior is Enabled multiline close without triggering shortcut g:AutoPairsShortcutToggleMultilineClose by myself.When I restart vim, it's default setting is Disabled multiline close unless I take the initiative to trigger and switch to the Enable multiline close. In other words, I only need Enabled multiline close and set it as default.

@LunarWatcher
Copy link
Owner Author

LunarWatcher commented Jun 19, 2021

I use the old option for that (as in the one that was used prior to the initial change), but it's set to 0 by default. let g:AutoPairsMultilineClose = 1 in your vimrc to enable it by default

@StarfishC
Copy link

Thanks, I thought this option was deprecated.

@LunarWatcher
Copy link
Owner Author

It was - I undeprecated it. I deprecated it in the first place because it wasn't used. Now it is, again ^^"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request status:In progress
Projects
None yet
Development

No branches or pull requests

2 participants