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: | Editor should allow you to view non-visible characters such as tabs, spaces, carriage returns, and EOF. | ||
---|---|---|---|
Product: | editor | Reporter: | Jon Koplin <jkoplin> |
Component: | -- Other -- | Assignee: | issues@editor <issues> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | arharp, austvik, drslump, dstrupl, err, hmichel, hubbitus, janicki, lhanson, vnicolici |
Priority: | P4 | ||
Version: | 3.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 179047, 143309 | ||
Attachments: |
font to show spaces
source for font |
Description
Jon Koplin
1999-11-02 19:44:53 UTC
Priority is changed to P4 (normal). Only changed version to Development. Target milestone -> 3.3 Re-assigning issues back to the bugs@editor.netbeans.org Changing the state of the issue to ASSIGNED, because it was cover in Requirements document at http://editor.netbeans.org/doc/Requirements.html Target milestone -> 3.3.1. Set target milestone to TBD Set target milestone to TBD Changing subcomponent to ui. *** Issue 58744 has been marked as a duplicate of this issue. *** *** Issue 146275 has been marked as a duplicate of this issue. *** *** Issue 153796 has been marked as a duplicate of this issue. *** please note that bug 153796 had 17 votes (and was therefore on the high-score list of most popular enhancements to fix) before it was closed as a duplicate of this on. There are lots of duplicates for this issue. Personally, highlighting whitespace *at end-of-line* is what I am looking for. I personally want to see all tabs and all spaces in some fashion that doesn't make them stand out (e.g. color similar to the background, but enough visibility to tell the difference between the tab and space. I'm very OCD about it. This is programming style I personally use, and seemed to work for me well, but requires to see the spaces/tabs (unless the editor would do it automatically which might be even better). Basically I use tabs as indentation, but there are places where spaces are necessary, e.g. inside of comments, etc. Here's an example: int main () { <T>printf("Hello \ //<SP><SP>A comment <T><SP>world");<SP>//<SP><SP>block <T>return 0; } Basically the tabs are ONLY on the left side. The benefits of this, is that the code always looks well despite of the tab size. I can do it manually, but to do it, I have to see tabs and spaces. I'm sorry for losing the votes. this bug is ooold, has many votes, the function requested is standard in just about every modern text editor. why is the target milestone always changed? how come that nobody fixed in _9_ years? too bad i only use qt and have no intention to ever write anything in swing. in qt this function is done in only about 20-25 lines (that includes the checkbox-setting in the menu and the description of the vector graphic used to visualize a tab or a space. you can look at it in the kate sourcecode) since i don’t think it is worked on (nobody needs 6-7 years to fix this) i change the status to “new” instead of started. i know that the “convert tabs to spaces” part is implemented for a long time, but this is the root feature request every “higlight tabs and spaces” request is marked as dupe for. and nobody works on this, i’m sure. If someone can help me get started on this, I'd be more than willing to contribute on this task. Does anyone have an idea of where in the source to start? I'm just not sure where the code for controlling the output of the source window is... I wish to toggle quite often between ShowWhiteSpaces and HideWhiteSpaces mode. Therefore I would like to get a hotkey as well for this switch, if it is possible. Thanks! And yes, I am voting for this issue too. (In reply to comment #18) > If someone can help me get started on this, I'd be more than willing to > contribute on this task. > > Does anyone have an idea of where in the source to start? I'm just not sure > where the code for controlling the output of the source window is... org.netbeans.editor.DrawEngine and related classes. Please note that improvements in DrawEngine may go in vain due to new view hierarchy issue #121357. *irony on* Yeah! Basics are coming in version 6.9 or 7 or 8, well, maybe 9. Well, realistic target milestone will be 10. Wordwrap and show whitespace (arrows for tabs and dots for chars). *ironie off* Just voted. :-/ Voted too *** Bug 180882 has been marked as a duplicate of this bug. *** Although the brute-force solution is to make all tabs/spaces visible as light grey arrows/dots, a more clever IDE might only make tabs/spaces visible where they aren't expected: 1. Spaces indenting lines in a normally tab-indented file, or tabs indenting a normally space-indented file. 2. Any spaces or tabs trailing the ends of lines 3. Tabs whenever they appear in the middle of a line. (I don't think there is any reason for them to (ever?) be used there.) 4. Two or more spaces in the middle of a line, except maybe within a string. Anywhere else, tabs/spaces could be left invisible, to maintain readability. However an option (in the View menu?) to force all tabs/spaces to be shown would be useful too. Note, This might need to be coordinated with the existing "Format" tool, so that the editor and Format agree on what looks "unexpected". <opinion>Netbeans has so many impressive editing features that the mere existence of this rather basic feature request seems odd. Hopefully it can be given a greater priority. These "intelligent" features are needed (expected?) in a source code editor... they set an IDE apart from a plain text editor, like 'vi'. </opinion> I think janicki's "highlight unexpected"feature (Comment #25) is a great idea. However I think it should be a part of language-specific highlighting built on top of whatever editor support is added to show non-visible spaces in the first place, with each option individually selectable, and independent of the editor-general show tabs & spaces / show line endings features. I think this should be a separate feature request. (BTW, this may not be common, but some people DO use tabs mid-line to line up elements in their code, like multi-line comments that fall after code lines, variable names in a list of declarations, array. This may be more common in some languages than others.) I seconded ericjs's reply. Let this bug just be about a basic show-non-visible-characters mode that can be used by everyone, no matter what the language or mode. Given the age of this feature request for "basic" level support I don't see adding "nice to have" ideas as the best way to get it moving forward seems there would be atleast 1 Java developer with a couple hours to come up with a way to implement this - adding in bells and whistles takes that couple hours and turns into a couple days which is far less likely... just my 2 cents - anyone consider getting a pool of money together to contribute to anyone that fixes/adds a given bug/feature?? I know of a few web-sites that offer this feature though none pop into mind. I know I'm willing to offer $5 to anyone that adds this into Netbeans since it's one of a handful of annoyances that are near deal breakers (I'm still using it - just feels wrong not to have such a basic IDE feature) Integrated into 'main-golden', will be available in build *201003050200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/3ed1fede4c1b User: Vita Stejskal <vstejskal@netbeans.org> Log: #4619: adding 'Show Non-printable Characters' action to 'View' main menu (note: it's disabled until #121357 is resolved) Integrated into 'main-golden', will be available in build *201003110200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/14e6506077de User: Vita Stejskal <vstejskal@netbeans.org> Log: #4619: connecting 'Show Non-printing Characters' View menu item with the new view hierarchy @ vstejskal@netbeans.org thank you so much for working on this, its highly appreciated. I just ran the 201003110200 build, and the option of "Show Non-printing Characters" enables and disables correctly. Maybe am missing something here but, there is no changes what so ever on the editor regardless of the status on the item on the menu. Is there any extra options i need to setup? Or is only the item on the menu working and the "show/hide characters" on the editor is not implemented yet? Sorry if it is something silly i missed, i just cant find a way to get it working. Thanks a lot again, this feature is very important for my work. R (In reply to comment #32) > ... Is there any extra options i need to setup? I'm sorry, but the new view hierarchy is not stable enough and so it is turned off in the builds. Please be patient, we are working on it and will turn it on as soon as possible. (In reply to comment #33) > I'm sorry, but the new view hierarchy is not stable enough and so it is turned > off in the builds. Please be patient, we are working on it and will turn it on > as soon as possible. Thank you for the quick response. I dis some digging and found the main bug for the new view hierarchy, anyone interested on the status of this keep an eye on the following: http://netbeans.org/bugzilla/show_bug.cgi?id=121357 Created attachment 97902 [details]
font to show spaces
as a workaround i've created a font that has a visible character for space.
install the font, and set the whitespace font to this and you will then be able to tell tabs and spaces apart.
Created attachment 97903 [details] source for font and here's the source file for the font. created with FontForge http://fontforge.sourceforge.net/ The "Show Non-printable Characters" menu item is no longer available in 6.9 RC2. Has this been abandoned for 6.9? This is extremely basic and universal functionality for a text editor. It would really be a shame if this got put off even longer. (In reply to comment #37) > The "Show Non-printable Characters" menu item is no longer available in 6.9 > RC2. Has this been abandoned for 6.9? Yes. The new view hierarchy was not in good enough quality for the release. See details in issue #121357. This has been added for 6.10 - it is now in dev builds and should be part of 6.10 M1 - and 6.10 release if everything goes well. Thanks so much to everyone who worked on this! I noticed one small problem. HTML doesn't seem to pay attention to the color specified for whitespace. Is this something that can be easily fixed? Please file a separated issue agains it. Thanks Two issues I noticed in 6.10m1 so far (both explicitly mentioned in the title): 1. Carriage returns are not displayed. They may be important e.g. in scripts for tools that handle them incorrectly. For finding such problems another editor would be needed. 2. After the last line an EOL symbol is shown, instead of EOF (or possibly nothing). This is misleading, and may hide why the last line is being ignored or the entire file is being rejected. Should it be reopened or marked incomplete until these get implemented? In response to Comment #42: No, please log 2 new separate issues for each of the mentioned problems. Thanks. |