Rearranger write-config-to-file bug?
I have a number of separator comments that have 2 leading spaces, like so: ('_' indicates space):
__///////////////////////
__// some header here
__///////////////////////
I've been unable to track this down and I'm not sure where/why this happens, but I've noticed that very often, the 2 spaces get converted to 1 space in my configuration, both in the UI and the config-file to which I save it.
I've picked 2 spaces specifically so that it matches my indentation level. Having it converted to 1 space makes rearranger (over time) insert multiple comments. Here's why; I hit ctrl-alt-r, rearranger inserts the comment. Idea then reformats the code and changes the comment spacing to 2 spaces instead of 1. The next time I hit rearranger, it doesn't "see" the comment due to the different spacing, then inserts it again.
Just today I added another separator section, checked the spacing, and wrote the configuration out to the file. The output shows 1 space, even though the UI shows 2.
Any ideas on how to fix this? And/or make Rearranger ignore leading whitespace when it's doing its "is this comment already here" check?
Thanks
Please sign in to leave a comment.
Hi Michael,
I will check into the configuration file problem. And I have your request to ignore leading spaces in checking for comments. I'll try to get them into the next release.
-Dave
Michael,
Your lucky day.. :)
In version 2.9, Rearranger correctly saves and restores multiple consecutive spaces from the configuration file. I guess that IDEA sets the XML document format to "normalize" text (strips out all but the minimum whitespace to keep it readable). So I worked around that.
The plugin will also now ignore leading spaces in testing for previously generated comments.
Please let me know if you have any trouble. I think you might be my main tester on this!
-Dave
Both of the issues I raised seem to be fixed satisfactorially; thanks. I looked at the config file and freaked for a second, till I realized you were escaping the leading spaces with backwhacks. =)