An Oracle blog about NetBeans for PHP

Line wrapping. Help us

Guys from editor infrastructure asked me to help him to test new editor infrastructure that brings up also line wrapping features. Probably you remembered that this feature was enabled during NetBeans 6.9 development, but because it introduced many problems and there wasn't time to stabilize it enough, it's not in NetBeans 6.9 available. 

We would like to stabilize the new infrastructure as much as possible before it will be switch on to be be available by default.You can enable the feature in development build through command line option: -J-Dorg.netbeans.editor.linewrap=true . Do it only with a development build, even if the optoin works in NetBeans 6.9, the new infrastructure is not stable enough there.

So I would like to ask you, if you use a latest development build, run the build with the mentioned option. You can start NetBeans from command line with the option or place the option in the ${nb_dir}/etc/netbeans.conf file (add into netbeans_default_options).

When you started NetBeans with this, there should be Line Wrapping option in the formatter.

When you find out an issue with it, please report it in our Bugzilla. For such issue the product should be Editor, component Painting & Printing and please mark all reports with the status whiteboard: linewrap so we can easily track them. The tentative plan is to enable this again for M1 of NetBeans 6.10 but this all depends on the additional feedback and testing.

Thanks for your help with this.

Join the discussion

Comments ( 18 )
  • tufan Thursday, July 22, 2010

    you have an arrow to show the wrapped line endings. my netbeans cannot display this character. a rectangle is shown instead.... (nightly build on ubuntu 32bit)

  • Greg Thursday, July 22, 2010

    It would also be nice if the wrapped line matched the previous lines indentation....

  • asdf Friday, July 23, 2010

    +1 for the idea of matching the previous line's indentation (plus additional tabs/spaces if wanted).

    TBH I'd have liked to see a setting for newlines. Working w/ Windows and not being able to create Unix-style newline files is a big problem - especially for people that are not used to this most basic setting not being available (that is: new users of your IDE). I'm aware of your logic and stuff, but it's still not sufficient. That's an editor feature missing.

  • Alex Friday, July 23, 2010

    At first I thought it doesn't work. Then I figured out that only lines longer than \*the window\* not than the set right margin (that vertical red line) are wrapped.

    And yes - it would be really nice if wrapped lines maintained its indentation.

  • Sam Vloeberghs Friday, July 23, 2010

    +1 for maintaining the wrapped lines' indentation!

  • Pet Friday, July 23, 2010


    there is command line switch which works for me


    Then new files are created in UNIX style.

  • Maghiel Dijksman Sunday, July 25, 2010

    I still don't get why all this time is spend on such a useless feature. Imho line wrapping should not be necessary; the developer should break of lines himself after a number of characters. A feature like word wrapping encourages bad practice!

  • Arnaud Lemercier Sunday, July 25, 2010

    Yes, I already opened issues about

  • gawan Monday, July 26, 2010

    +1 for maintaining the wrapped lines' indentation!

  • php/ajax Monday, July 26, 2010


    I was looking for this feature the other day but I was very disappointed when I found out that it was not supported.

    Glad to hear that it's coming in the next release.

  • Sundar Monday, July 26, 2010

    +1 for maintaining indentation

    it would be nice if we can show a arrow in the line number column also, instead of keeping it empty

    if we make it as customizable to a file (may be in view menu) it will be more helpful

  • Linkious Saturday, August 7, 2010

    Maghiel Dijksman: I agree with you. But sometimes when you take over an existing project you just have to scroll to view the whole lines. Wrapping would be a huge time saver in such sitations.

  • Maghiel Dijksman Saturday, August 7, 2010

    @Linkious: true, but personally I wouldn't bother to read those lines too well. If the option is there, I would contact the previous developer and let him explain what the snippet does.

    If that is not an option, I still wouldn't go in depth, but start some drastic refactoring.

  • Anatoly Tuesday, August 10, 2010

    -1 for maintaining the wrapped lines' indentation

    Wrapped lines should be easily noticeable among all the "normal" lines of code. Indentation will produce the visual mess in case of several differently indented and the same time wrapped lines. You will not be able to understand which line is visually autowrapped, which is really "hardwrapped" (splitted).

    And don't mess up two different options: 1) visual wrapping of long lines (longer then edit area width) and 2) automatic splitting of the code/string (in the specific way for each language) longer then the margin set (e.g. 80 chars). In my programming work I need first and hate second feature :-)

    Thanks to devs for the so long waited really must-have feature.

  • BazMaster Monday, October 18, 2010

    +1 к опции LineWrap!

    У меня не получилось включить опцию LineWrap по умолчанию. Я пробовал вписать в файл etc/netbeans.conf следующее:

    -J-Dorg.netbeans.editor.linewrap=true to the netbeans_default_options.

    Может это я неправильно вписал?

  • BazMaster Monday, October 18, 2010

    Я понял как надо и исправил файл etc/netbeans.conf.

    Я просто добавил фразу -J-Dorg.netbeans.editor.linewrap=true в netbeans_default_options.

    У меня получилось следующее:

    netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.pmoffscreen=false -J-Dorg.netbeans.editor.linewrap=true"

    Но всё равно галочка LineWrap не работает в Опциях...

  • Russ Wednesday, November 3, 2010

    I would like to see the line wrap feature be available on a per-file basis. I would like to be able to toggle it on/off (with, for instance Crl-W) at will for a given file. Why? I not only use Netbeans to develop the code, but it executes testing scripts that produce a log with long output lines. I usually need to glance at the wrapped log and then go back to the source code files in unwrapped mode. (For an example of this feature in operational mode, see Ultra_Edit IDE.)

  • kabin Saturday, December 11, 2010

    ogy of the future is being made today.

    After a 15 hour return journey my colleague and I look back on a great conference.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.