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.
Maybe this is pushing my luck a bit, but I have switched off 'Insert closing bracket automatically' in the editor but this also stops the editor making any attempt to align the brackets once I add the closing bracket manually. It would be nice if the two aspects of closing brackets were kept separate so that switching off auto-completion did not also switch off auto-alignment. Well, I can ask can't I !!
Switched "Insert closing brackets automatically" off. I've tried to type if (true) { <Enter> The closing '}' was not inserted. When typing it manually then it was reindented appropriately automatically. So I assume you've probably meant something else. Could you please give an example? Thanks.
With "Insert closing brackets automatically" switched off, what I was hoping it would do (after manually typing in the closing bracket followed by return) would be to end up looking like this... if (true) { } ...however it ends up looking like this... if (true) { } When I logged this request, I was editing Groovy files where this behaviour happened (and still happens). Before your response to me, I just so happened to edit a Java file and, Bingo, it worked just as I would want it to in the Java file - but not the Groovy file.
I see it's a defect in the groovy indenter then.
this is also a problem in the jsp editor.
I believe this is problem in any csl/gsf based language (at least groovy, javascript and php). I'm not an editor internals expert but debugger shows that ef.getReformatBlock() call in ExtKit.checkIndentHotChars() returns always null in csl context so reformat is not called. Any suggestions how this should be handled/fixed?
This affects many other languages.
As I suggested common problem for CSL languages...
This issue (still) exists with PHP in NetBeans 7.0 (Build 201104080000); (I also have noticed it it v6.9). In any instance with a opening/closing brace, the closing brace does not align with the opening brace's line. It is the same as described in Comment #2 (except with PHP). Also, along with Comment #2, the auto-alignment of the braces works fine in Java. ----- it should be: if (true) { } ...however it ends up looking like this... if (true) { } ----- Please fix!
Similar issue: http://netbeans.org/bugzilla/show_bug.cgi?id=158386
(In reply to comment #9) > Similar issue: > http://netbeans.org/bugzilla/show_bug.cgi?id=158386 Ops, wrong link... The correct is: http://netbeans.org/bugzilla/show_bug.cgi?id=203087
Just created an account to say that this is a game-breaking bug for me and it is the only reason keeping me from using NetBeans.
Typing Hooks API should be used to solve this problem.
Dusan, could you be a little more specific? What do I need to do on the Groovy side to make this work properly? As far as I understood the discussion this isn't groovy language specific problem (referred comment #5 it's more a csl issue)
Reassigning to CSL (CslEditorKit should be changed and use Typing Hooks API instead of the old deprecated solution - see Editor Library 2 module for more information about Typing Hooks API)
I am sending back. Groovy Editor or another client should implement their own TypingHooks and delete old KeystrokeHandler. See coming changes in Bug #217163
Setting TM to Next. I don't want to rewrite the code to use Typing Hooks few weeks before 7.3 FCS. I'm going to do this in the early 7.4 development..
Fixed for groovy in: web-main #7a71d98c1c5f At the end it wasn't needed to rewrite code with Typing Hooks API. Anyway I'll do that in early 7.4 as the new API looks much better than the old KeystrokeHandler.
Integrated into 'main-golden', will be available in build *201212130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/7a71d98c1c5f User: Martin Janicek <mjanicek@netbeans.org> Log: #158386 - Switching off auto-brackets also stops auto-alignment