-
Notifications
You must be signed in to change notification settings - Fork 7
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 permanently disable parinfer, or issue warning #1369
Comments
Yes, this is a bad problem I'm going to fix for the next release. There are two issues here: first, even if parinfer reindents code, it should not break it since it should run paren mode to correct the indentation first. Then at worst, you'll get some spurious changes in your files. However that's problematic too, so I'm going to try to modify parinfer so it only does the indentation correction on first change, rather than on file open. Then at least toggling through parinfer mode won't change anything, and being in parinfer mode won't change files just by looking at them. I also considered having the toggle switch between structural editing being off totally and the mode (parinfer or paredit) that you have selected, instead of cycling through the three. However it's problematic when the user toggles when structural editing mode is off. I'd have to remember the previous mode that the user selected in that case. It would also mean that there would be no way to get from parinfer to paredit and back without using the status bar toggle or the config pane. |
+1 to this issue. My editing workflow has been pretty severely impacted from the spurious changes that occur when I flip past parinfer to no-structural for small changes. I like the idea of breaking down structural on/off structural-style=paredit/parinfer(indent|paren). Reformatting on first edit also sounds like good business. |
Ok, I've fixed the bug where toggling the structural style would break code - that wasn't running paren mode to correct indentation when entering parinfer mode, which would break code. I've investigated making parinfer modify the indentation on first change, but that's difficult. I thought I could do it by hooking into the action system and making the change on the first action, or before typing. However since in IntelliJ everything is an action, it would be triggered on (for example) toggling the style again, switching to a new file, etc - there's no good way to distinguish actions which will modify the document. So I've added some config under Editor→General→Smart Keys which allows you to select which of the 3 modes the toggle action should cycle through. So you can set it to just Off and Paredit and it will switch between them, or Off and Parinfer, or Parinfer and Paredit, or leave all 3 selected and it will cycle through them all as it does now. |
It has occurred already twice on me that I accidentally enabled Parinfer mode, and then noticed several hours later that one of the CLJ-files opened at the time Parinfer was enabled, suddenly did not compile anymore, because Parinfer altered some parens that were not correctly indented for Parinfer mode.
This is quite dangerous: while most of my files are correctly indented for Parinfer, not all of them are.
I would suggest to:
Or did I miss something?
The text was updated successfully, but these errors were encountered: