java - How do I stop IDEA from reformatting my code when refactoring? -


when refactoring code (e.g.: refactor -> rename), intellij idea 14.x rewraps (reformats) code fit 80 column limit.

example: here's code before refactoring: enter image description here

refactoring in progress: enter image description here

... , code re-wrapped once press enter: enter image description here

what's annoying that, java classes aren't open in editor (but affected refactoring) reformatted, increasing chance formatting changes propagated vcs unnoticed.

what want achieve is:

  • keep original print margin @ 80 columns, still
  • have idea preserve original formatting when renaming variables/classes/methods.

how achieve this?

if doing actual "refactoring -> rename", example shift + f6 are editing every file has reference variable name whether or not open in editor irrelevant if change files affected edited , vcs consider them changed.

the behavior of reformatting entire file on refactoring been in idea long time , bugs have been filed against behavior have been setting in unassigned state forever. here 1 example.

i doubt behavior going change, 1 hope not.

if want ridiculously long variable names need either turn off right margin or make ridiculously long well. or change whatever configuration causing things formatted differently.

personally set relevant things always whatever not have somethings formatted 1 way , somethings formatted different way. consistency more important else in large code base.

the vcs tools in idea extremely powerful , unmatched in other ide. can see has changed , exclude them commits or fix them how want.

idea has format on commit checkbox various version control systems supports well.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -