How to disable template auto-format in Eclipse?
- by Matiaan
I have a template (sleep) in Eclipse 4.2.1 that should expand to
try { Thread.sleep(1000); } catch (Exception e) {}
I want Eclipse to add it as one line, just as I put it in the template. However, Eclipse autoformats it after inserting to:
try {
Thread.sleep(1000);
} catch (Exception e) {
}
I have tried @formatter:off, but that does not work. I have code cleanup switched off.
Is there any way to disable formatting for all templates, since the only templates I use are one-liners anyway?