Word Wrap in ColdFusion Builder

Tuesday, July 14, 2009

You may have noticed that ColdFusion Builder does not have Word Wrap – like FlashBuilder and Zend Studio and Aptana and all the other Eclipse derivatives out there. The reason is that it’s not in Eclipse itself. I know, I know… notepad has it, why doesn’t Eclipse? If you’re interested in the gory details, you can read the bug and its comments: https://bugs.eclipse.org/bugs/show_bug.cgi?id=35779

One of the reasons for not supporting word wrap natively is that line numbering is a tricky thing to contend with, particularly with respect to breakpoints and debugging. If you don’t really care about that stuff but just want a word wrap that’s “good enough”, you’re in luck.

A Word Wrap Plugin

Ahti Kitsik wrote a word wrap plugin a long time ago: http://ahtik.com/blog/eclipse-word-wrap/. This is the update site: http://ahtik.com/eclipse-update/

Once installed, you enable virtual word wrapping by right clicking in the editor and selecting “Virtual Word Wrap” in the context menu. You turn it off in the same manner.

It works “good enough”. The major downside is in how it deals with line numbers. Let’s look at a picture of some code without line wrapping turned on:


Notice each line gets a single line number.

Now, let’s look at it with Virtual Word Wrap turned on:


See the problem? Up there in the top, each “virtual line” gets its own line number. This is clearly incorrect and it’ll cause problems if you’re trying to do step-through debugging.

Lighten up

That last problem, though, is more of an inconvenience than a problem. If you need to do step-through debugging and the line numbering thing is tripping you up, just right click and turn it off for a bit. Or hit the “enter” key in your text and get rid of your long lines (they’re annoying, anyway. Trust me).

Should Eclipse have word wrap? Absolutely. Will it any time soon? Don’t hold your breath.


Terry Ryan has posted the "correct" way to enable word wrapping here: http://www.terrenceryan.com/blog/index.cfm/2009/7/14/Word-Wrap-in-ColdFusion-Builder. I, for one, am not a fan of this method of line wrapping at all. I want to be able to easily toggle it on and off. My 2 cents.


Bliss said...

Thank you! Thank you! Thank you!

Terrence Ryan said...

Actually, Word Wrap is in ColdFusion builder already. I've blogged about it here: http://bit.ly/17zu7R

Marc Esher said...

thanks Terry. I'm not a fan of its implementation, as line wrapping shouldn't require a restart. But at least it's in there for the people who want it.

mrgccc3 said...

ctrl-3 then "word w" is how I do it. But I guess that may require Eclipse.