-
Notifications
You must be signed in to change notification settings - Fork 6
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
Option to Move Openinig Brace to the Next Line in "Insert new indented line after Return" #57
Comments
I have mixed feelings about this. Implementing only that is trivial, but unless you want to end up with
there's going to be some awkward config. I can set it up, I just don't really see the advantage. Would complicate pair initialization, or cause weird artifacts like the example above otherwise. Doesn't particularly help that context and personal preferences play in a lot more. Also seems like a thing a proper formatter should handle, in my opinion, but that depends on languages, other plugins, and other Fun Stuff:tm:. But applying formatters on a bigger range does have its cons. Off the top of my head, with C++ and clang-format, it's possible to configure it to have empty or short functions collapse. Formatting on the example you gave with that setting enabled would cancel out the 4.0.0 has been fairly stale so far (largely because it's hard to rework all the code), but this feels like a good candidate for that. Configuration is the main issue, and I do plan to rework parts of the config system for pairs. The original configuration system leaves a lot to be desired, and while 3.0.0 does work on the "backend" for that, it still lacks a sane, user-facing API with easy operations. Gonna chalk this down to 4.0.0 for now, and further investigation when I actually start making actual progress on 4.0.0. Still got mixed feelings about it, but I'm not sure how much of that comes from the awkward config system inherited from jiangmiao and my brain more or less noping at the thought of setting it up, so not gonna shoot it down for now. |
If it's a design issue that's making things complicated I can only say from experience that, the sooner one tackles it, the better. |
I know, which is why I've scheduled a rewrite for 4.0.0. v3 ended up being features, and along with initial design issues inherited from jiangmiao, the configuration is periodically awkward. It's a lot better than it used to be at least. The main obstacle at this point is time (occupied with a lot of other stuff), and not really being sure how else to design it. Seems I forgot to say this explicitly, but this issue did bring up a few ideas for how I can go about that. 4.0.0 is, in either case, a while away. There's a lot of technical debt to sort out, and taking care of it isn't gonna be fun :') |
This has now been implemented on the 4.0.0 branch. Turned out to be deceptively easy to do. Both the options for expansions are admittedly very aggressive, and expand independently of context. There is an option for disabling expansion in strings, and I plan to expand it to comments, and possibly arbitrary syntax groups for flexibility. Aside that, ignoring insertions is also an option, and so is temporarily toggling auto-pairs. If you've already defined |
Hi @LunarWatcher, sorry if this is a beginner question. Since I'm using nvim with the |
@baltermia You'll have to translate to Lua on your own. I don't use nvim. You want whatever the equivalent of |
As stated in the feature pressing inside brackets places the second brace and the cursor conveniently:
Some of us prefer the first brace to be separated from the function/function paramerters. Would it be possible to add a feature so that there is an option to obtain such behabiour:
The text was updated successfully, but these errors were encountered: