This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
|Summary:||Allow to control line separators (line endings, eol) - plugin available|
|Product:||editor||Reporter:||Miloslav Metelka <mmetelka>|
|Component:||Formatting & Indentation||Assignee:||Dusan Balek <dbalek>|
|Severity:||blocker||CC:||CheeseSucker, cifroes, ericrbs, halufa, iotriado, JerryWho, kAlvaro, MackSix, markiewb, mfriedenhagen, mwisnicki, pjiricka, polycaster, popov130, postmoderncore, PyKaB, rastrano, RayDeCampo, st3vie, tmysik|
|Issue Type:||ENHANCEMENT||Exception Reporter:|
|Bug Depends on:|
Description Miloslav Metelka 2006-02-10 11:31:52 UTC
User should be able to override the line separator type (CR for Mac, LF for Unix or CRLF for Windows) - e.g. through a menu item under Edit menu that would display the present value and allow to change it through a set of radio buttons in a submenu: | Line Separator +-----------+ | o Windows | (one of the radio buttons would be checked) | o Unix | | o Mac | +-----------+ On the implementation level it would only be necessary to change BaseDocument.READ_LINE_SEPARATOR_PROP appropriately and mark the document as modified so that it gets saved.
Comment 1 Vitezslav Stejskal 2008-09-23 11:45:05 UTC
There have been usecases requesting this for both newly created files and existing files opened in the editor. Also, please see all the duplicates. As a workaround it should be possible to use '-J-Dline.separator=' property and set it to the appropriate EOL character(s). This will affect the whole IDE and not only the editor. Please remember that even with line.separator property set the IDE is still going to use a line separator detected in existing files when they are open in the editor.
Comment 2 Vitezslav Stejskal 2008-09-23 11:45:42 UTC
*** Issue 132679 has been marked as a duplicate of this issue. ***
Comment 3 Vitezslav Stejskal 2008-09-23 11:46:08 UTC
*** Issue 35233 has been marked as a duplicate of this issue. ***
Comment 4 Vitezslav Stejskal 2008-09-23 11:46:22 UTC
*** Issue 73044 has been marked as a duplicate of this issue. ***
Comment 5 Vitezslav Stejskal 2008-09-23 11:46:35 UTC
*** Issue 113928 has been marked as a duplicate of this issue. ***
Comment 6 Vitezslav Stejskal 2008-09-23 11:48:46 UTC
*** Issue 113928 has been marked as a duplicate of this issue. ***
Comment 7 Petr Dvorak 2008-10-25 18:42:48 UTC
*** Issue 151262 has been marked as a duplicate of this issue. ***
Comment 8 Karthikeyan Rajeswaran 2008-11-12 22:29:51 UTC
nbusers forum threads on this issue: http://wiki.netbeans.org/ForumThreadsOn72515
Comment 9 Vitezslav Stejskal 2009-03-26 16:39:10 UTC
*** Issue 152688 has been marked as a duplicate of this issue. ***
Comment 10 Vitezslav Stejskal 2009-03-26 16:40:13 UTC
*** Issue 159124 has been marked as a duplicate of this issue. ***
Comment 11 Vitezslav Stejskal 2009-03-26 16:42:27 UTC
Issue #159124 points out that: Netbeans handles line endings differently depending on how a new file is created. (Using Windows Xp sp3) - Create a PHP file by File->New File...-> PHP File and the resulting file has Unix line endings. - Create a blank file and it has Windows line endings.
Comment 12 Tomas Mysik 2009-06-11 09:21:02 UTC
*** Issue 166887 has been marked as a duplicate of this issue. ***
Comment 13 Vitezslav Stejskal 2010-01-20 05:43:13 UTC
*** Bug 169651 has been marked as a duplicate of this bug. ***
Comment 14 Vitezslav Stejskal 2010-01-20 05:43:31 UTC
*** Bug 179700 has been marked as a duplicate of this bug. ***
Comment 15 knitter 2010-01-26 05:14:00 UTC
Changing line endings is a very common feature, and given the examples in the PHP module's list and the requests from users, one that could be useful to have in the IDE. I believe the feature would be simple to implement and would be useful to the users.
Comment 16 _ moser 2010-01-26 06:57:05 UTC
Certainly NetBeans is more than an editor, but however, essentially it is a comfortable editor. And for an editor it is a key feature to allow a user to control a file's line endings. So it's astounding (for me) that NB came up to version 6.8 without that feature.
Comment 17 Vitezslav Stejskal 2010-05-12 12:23:22 UTC
*** Bug 185973 has been marked as a duplicate of this bug. ***
Comment 18 postmoderncore 2010-07-17 23:57:43 UTC
I consider this an obvious feature for a cross platform development IDE. Whilst, as others have pointed out, version control systems will take care of line endings, this doesn't cover all scenarios.
Comment 19 nbphpuser 2010-07-18 08:36:19 UTC
-J-Dline.separator= Does this switch work? If so, how to use it forcing UNIX line endings under windows?
Comment 20 PyKaB 2010-07-21 08:08:27 UTC
it would be logical to implement like this: right click on project -> Properties -> Source: Encoding, EOL char
Comment 21 David Strupl 2011-02-28 16:29:06 UTC
*** Bug 194897 has been marked as a duplicate of this bug. ***
Comment 22 dio5 2011-03-01 08:43:22 UTC
I think ideally it should do something like editpad pro or the like: display the current line ending format on the bottom of the page for example 'windows'. Clicking it shows a dropdown to convert it to one of the others like unix or mac. I spent hours on a project which wasn't under version control and needed to upload through ftp which threw the most weird errors ever. Turned out some files had mac line endings which got screwed up through ftp (still haven't figured out what went wrong, it worked locally on windows & unix.) All the line endings misery could be so easily solved if it would just display the currently used line endings somewhere in a status bar and would have the ability to convert it. I'm amazed that such a great editor like Netbeans doesn't have this option.
Comment 23 dio5 2011-03-01 08:46:44 UTC
Oh yes, seeing this has been reported since 2006... What are you waiting for?
Comment 24 Jan Lahoda 2011-03-09 13:00:19 UTC
A plugin that shows the line endings of the currently edited file and allows to change them: http://plugins.netbeans.org/PluginPortal/faces/PluginDetailPage.jsp?pluginid=36810
Comment 25 iotriado 2011-03-10 07:26:13 UTC
Your plugin is ideal for this issue. Thank you
Comment 26 dio5 2011-03-23 21:04:02 UTC
Perfect, plugin is exactly what's needed.
Comment 27 Alexander Pepin 2011-04-26 14:08:16 UTC
*** Bug 198072 has been marked as a duplicate of this bug. ***
Comment 28 monk.e.boy 2011-09-21 09:08:15 UTC
Hi, just to remind everyone that I'm still getting bitten by this issue :) had some mysterious errors when running a .php file from cron, turns out the file had been created using NetBeans and had Win EOLs in it :( Extension '/home/xxxxxxxx/do_things.php' not present.
Comment 29 Jeffrey Rubinoff 2011-09-21 09:29:57 UTC
(In reply to comment #28) > Hi, just to remind everyone that I'm still getting bitten by this issue :) had > some mysterious errors when running a .php file from cron, turns out the file > had been created using NetBeans and had Win EOLs in it :( > > Extension '/home/xxxxxxxx/do_things.php' not present. Have you tried the plugin?
Comment 30 terje7601 2012-07-06 18:04:07 UTC
Please add the plugin to the NetBeans core. It works great & this is essential functionality. Imho, other things that should be added are: 1) setting the EOL on a global level in Options (-> Editor -> Formatting seems like a logical place to me) 2) setting the EOL on a per-project basis (under Formatting again) 3) a way to change the EOL of selected resources, analog to the new Source -> Format functionality to format not just files, but whole folders & projects. This would be needed because the EOL settings should only be applied to newly created files. Pre-existing files, or files that are imported from outside the editor (by drag-and-drop for example) should not be converted automatically, even when editing & saving them.
Comment 31 stefanocrosta 2013-03-22 18:56:11 UTC
I totally agree with firstname.lastname@example.org This ticket should probably be updated to apply to 7.x ?
Comment 32 katsuke 2013-05-26 01:03:24 UTC
Bump. Pushed requested version to the next version of netbeans since 7.3.1 i think wont be able to deliver this.
Comment 33 markiewb 2013-05-26 08:14:30 UTC
(In reply to comment #32) > Bump. Pushed requested version to the next version of netbeans since 7.3.1 i > think wont be able to deliver this. To do this you should have changed the target version not the reported version. BUT changing the target version to 7.4 won't make any NB dev to start working on this issue. Have you tried the plugin? PS: I changed the reported version back to 6.x
Comment 34 terje7601 2013-08-22 10:40:32 UTC
This functionality should also be made to work correctly with Templates: currently, when doing e.g. "New -> PHP Class...", the file contains the EOL of the template. In the future, the file should contain the EOL that is specified for the project.
Comment 35 Deebster 2014-03-25 11:12:18 UTC
I was surprised and disappointed that changing the line endings in the template had no effect on the line endings of created files. This fix would go some way towards fixing that.
Comment 36 Ninj 2016-12-14 10:52:55 UTC
Is there a project manager on Netbeans? If there is one, how can this 6 years old issue remain unsolved? The plugin, although a great job, is NOT the answer. I'm using a recent version of Netbeans and i'm still waiting for the plugin to become available. It's not a normal behavior for an advanced editor to go without line ending management. It is a very basic feature, needed over the other ones. Priority should be the highest. I cannot understand the few attention this issue is getting from the development team. Version 8, guys. 8! And there is nothing to manage line endings. No default option, no conversion tool. I can't believe it. Not to threaten (because it sincerely is not my purpose and because you wouldn't mind) but i was about to move to PhpStorm because of its much better Symfony integration: the line ending issue will finish to convince me :( Once again: please do not mention the plugin, it is not 8.2 compatible (and i'm always on development versions because we use advanced PHP features)
Comment 37 kAlvaro 2016-12-14 15:12:58 UTC
@Ninj PhpStorm is a commercial product that costs 120 to 200 €/yr and NetBeans is open source and gratis, what makes comparisons rather unfair. (That same commercial product has quite infuriating long standing bugs, anyway.) While I agree that the Big Corporations that have been passing NetBeans around could have used more resources, the bare fact is that the involved CEOs do not browse the bug tracker and coders who do will probably not feel the motivation in your words. Keep cool.
Comment 38 ericrbs 2017-07-18 19:44:13 UTC
This is a basic feature for text editor that is not implemented on version 8.2. We should have an option to define the global line ending for all files created in IDE and also an option to change it per file (in the editor) should be available. I think other IDEs should be use as reference to implement this in NetBeans: Eclise - https://stackoverflow.com/questions/1886185/eclipse-and-windows-newlines IntelliJ Idea - https://www.jetbrains.com/help/idea/configuring-line-separators.html Thanks.
Comment 39 sgrossberndt 2017-07-19 09:03:52 UTC
I found a solution about two years ago: I removed Netbeans from my compuser and started using PHPStorm/AndroidStudio instead. I don't see an option to remove myself from the CC list of this bug so I am going to delete my account now. No use for Netbeans anyway.
Comment 40 Ninj 2017-07-19 09:26:39 UTC
So did I, soon followed by the 7 developers of team I lead. Netbeans really belongs to the past, not because it has not good developers, but because it could not keep up with the terrible job made by JetBrain. Yes, it's paid, but in a professional environement, the time it saves worthes 10 times the money spent.
Comment 41 serban.nistor 2017-07-19 12:03:25 UTC
(In reply to sgrossberndt from comment #39) > I found a solution about two years ago: I removed Netbeans from my compuser > and started using PHPStorm/AndroidStudio instead. > > I don't see an option to remove myself from the CC list of this bug so I am > going to delete my account now. No use for Netbeans anyway. Implemented the same solution ~2 years ago as well with IntelliJ IDEA. Works like a charm ever since!
Comment 42 Mrugendra 2017-07-21 05:24:41 UTC
email@example.com Ninj@netbeans.org firstname.lastname@example.org I do not want to make this ticket as a ground for an argument over which IDE is better. But I would say a couple of things, sure there are other IDEs out there but there are certain feature and conveniences in Netbeans which are simply not thought through properly in other IDEs. I am primarily work with C++ and JAVA and I have tried CLion and Eclipse and I have struggled a lot to like them. I cannot say for other languages since I do not deal with them email@example.com You can probably remove yourself from the CC list of any of the bugs on this forum by choosing "My Votes" on the top and unchecking the box next to the bug for which you do not want to recieve updates/mails and clicking on "Change my votes"
Comment 43 sgrossberndt 2017-07-21 07:47:19 UTC
(In reply to Mrugendra from comment #42) > You can probably remove yourself from the CC list of any of the bugs on this > forum by choosing "My Votes" on the top and unchecking the box next to the > bug for which you do not want to recieve updates/mails and clicking on > "Change my votes" Thanks. Since I cannot find an option to delete my account either I did remove my vote for this bug now.