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.
it would be nice to have a way to show indentation guides, like in some other editors like scite or notepad++. Please find here screenshots of the feature in scite : http://img263.imageshack.us/img263/4958/indentguides1.png http://img716.imageshack.us/img716/3683/indentguides2.png
Created attachment 101196 [details] example of identation guide in Notepad2
I need also this feature. I think it could be easy to implement and it can help a lot (me at least ;) ) to write a better code. It's a little bit annoying (and ridiculous) when you have a large file and you detect an error (a missing closing tag by example) thank to indentation to be obliged to reopen it in an external editor just to better see where is the problem ... Thanks in advance
I used to work with SciTE and I really miss this functionality in Netbeans. Especially in Python where indentation is essential (I use Netbeans for PHP and Python). I think that indentation guides would give Netbeans a real advantage compared to its competitors.
I agree. This is the only thing that's keeping NetBeans to be the most awesome and feature full editor currently available. I'd kill for this feature. Wouldn't mind donating something if that would make it happen faster.
Any progress on this? This is the only thing keeping me from using NetBeans as my default IDE. I've gotten too used to this and can't get used to working without it.
Yes, please add this to a future release. It's hard to make sure everything is properly indented if you can't see vertical guides.
would be most useful this feature. many other editors offer this functionality.
hey.. is there any news about this enhancement?
Please give priority to this issue it would be a great improvement to netbeans.
*** Bug 206329 has been marked as a duplicate of this bug. ***
Please add this feature. It is the one and only thing I truly miss from my previous IDE.
This is really necessary thing sometimes. I vote for it.
I'm truly missing this function. additionally coloured guides would be awesome. http://img194.imageshack.us/img194/3428/screenshotfrom201207061.png you can get these with JEdit and the Candy Folds plugin. In the end I would be really happy to adjust: 1. colour 2. style of guide (doted, fuzzy,...) 3. thickness so you can distinguish a long loop from an if clause at a glance.
I think this would be a great addition to netbeans, this seems to be the missing piece to a perfect IDE. it just makes things so much easier when coding and trying to keep your code formatted nicely. would be nice to see on 7.2, but I'll make a guess it'll be added to 7.3 if its accepted by the developers.
*** Bug 203545 has been marked as a duplicate of this bug. ***
great feature, makes code look more structured
Please add this! This is small thing which makes a world of difference!
Please add this feature! I would love to see this in future releases.
Also wants/need indentation guides in netbeans I think is a really really usefull feature, Thanks
Would absolutely love this. Every program focused on any kind of code editing should have this built in. Unfortunately, Netbeans and Eclipse don't have it... :(
I think this is easy to implement and very usefull feature (source codes will become more readable). Please add it.
Yes please, is so useful. I should not be so hard and is so good to have.
Add this feature please
Please add this feature, please, please, please!
http://hg.netbeans.org/jet-main/rev/52536ddbf105
Integrated into 'main-silver', will be available in build *201311240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/52536ddbf105 User: Milutin Kristofic <mkristofic@netbeans.org> Log: #182513 - indentation guides
It seems the fix has wrong algorithm for calculating indent size. The fix uses: indentLevelSize = prefs.getInt(SimpleValueNames.SPACES_PER_TAB, EditorPreferencesDefaults.defaultSpacesPerTab); Should be: indentLevelSize = prefs.getInt(SimpleValueNames.INDENT_SHIFT_WIDTH, EditorPreferencesDefaults.defaultSpacesPerTab); Also suspicious code: if (propName == null || SimpleValueNames.SPACES_PER_TAB.equals(propName)) { releaseChildren = true; Integer indentLevelInteger = (Integer) docView.getDocument().getProperty(SimpleValueNames.SPACES_PER_TAB); indentLevelSize = (indentLevelInteger != null) ? indentLevelInteger : indentLevelSize; }
Alexander, in formatting options space_per_tab is called "Number of Spaces per Indent". Space_per_tab is old name, it should be renamed, but it has right value (default: 4) that I needed.
(In reply to Milutin Kristofic from comment #28) > Alexander, in formatting options space_per_tab is called "Number of Spaces > per Indent". Space_per_tab is old name, it should be renamed, but it has > right value (default: 4) that I needed. See java doc in class SimpleValueNames: /** * How many spaces substitute per one typed tab. This parameter has * effect only when EXPAND_TABS setting is set to true. * This parameter has no influence on how * the existing tabs are displayed. * Values: java.lang.Integer instances */ public static final String SPACES_PER_TAB = "spaces-per-tab"; /** * Shift-width says how many spaces should the formatter use * to indent the more inner level of code. This setting is independent of <tt>TAB_SIZE</tt> * and <tt>SPACES_PER_TAB</tt>. * Values: java.lang.Integer instances */ public static final String INDENT_SHIFT_WIDTH = "indent-shift-width"; According to this API C/C++ uses INDENT_SHIFT_WIDTH for indent size. See also: org.netbeans.api.java.source.CodeStyle: public int getIndentSize() { int indentLevel = preferences.getInt(SimpleValueNames.INDENT_SHIFT_WIDTH, getDefaultAsInt(indentSize)); if (indentLevel <= 0) { boolean expandTabs = preferences.getBoolean(SimpleValueNames.EXPAND_TABS, getDefaultAsBoolean(expandTabToSpaces)); if (expandTabs) { indentLevel = preferences.getInt(SimpleValueNames.SPACES_PER_TAB, getDefaultAsInt(spacesPerTab)); } else { indentLevel = preferences.getInt(SimpleValueNames.TAB_SIZE, getDefaultAsInt(tabSize)); } } return indentLevel; }
Ok, thank you Alexander. I will look at it and fix it.
Alexander, your suggestion is pushed to jet-main http://hg.netbeans.org/jet-main/rev/f88bed57f43c
(In reply to Milutin Kristofic from comment #31) > Alexander, your suggestion is pushed to jet-main > http://hg.netbeans.org/jet-main/rev/f88bed57f43c The fix does not work for C/C++. The property is null: docView.getDocument().getProperty(SimpleValueNames.INDENT_SHIFT_WIDTH) The indent size is: prefs.getInt(SimpleValueNames.INDENT_SHIFT_WIDTH, 0); As result the method getIndentSize() returns tab size instead of indent size. It seems the method getIndentSize() should reorder properties: 1.docView.getDocument().getProperty(SimpleValueNames.INDENT_SHIFT_WIDTH) 2.prefs.getInt(SimpleValueNames.INDENT_SHIFT_WIDTH, 0) 3.docView.getDocument().getProperty(SimpleValueNames.EXPAND_TABS) 4.prefs.getBoolean(SimpleValueNames.EXPAND_TABS, EditorPreferencesDefaults.defaultExpandTabs) ... and so on
Created attachment 143727 [details] proposed patch
Ok, my thought process was, if somebody is pushing some values to document, they have for him higher priority than values in prefs. My example is preview window in settings, where I give values in combobox. Why C/C++ has tab_size in properties but not indent_shift_width? But, ok, I make a change you suggested.
(In reply to Milutin Kristofic from comment #34) > Ok, my thought process was, if somebody is pushing some values to document, > they have for him higher priority than values in prefs. Yes you are right, but your commit violated it for INDENT_SHIFT_WIDTH. > Why C/C++ has > tab_size in properties but not indent_shift_width? I do not sure that C/C++ responsible for putting tab_size in the doc properties. It seems BaseDocument.init() do it. See 538 line. IMHO it is legacy code.
Thank you Alexander, I push your proposed patch. http://hg.netbeans.org/jet-main/rev/96a753902969
*** Bug 239537 has been marked as a duplicate of this bug. ***
Definitively a lack of courtesy toward the few who are using the editor in a non-programming platform and a real pain to go through multiple MIME types to remove them. Can we get this enabled false by default? DocumentViewOp line 927: boolean currentGuideLinesEnable = Boolean.TRUE.equals(prefs.getBoolean("enable.guide.lines", false); Or maybe a kill switch in the conf file? We have already -J-Dorg.netbeans.editor.linewrap; why not -J-Dorg.netbeans.editor.indentguide
@gwaldon: Please do not reopen an issue for an already released NetBeans version! Instead create a new issue and refer in the new one a link to the original issue.