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.
When having "Reindent Text" selected for "Tools->Options->Editor->Code Templates" "On Template Expansion" indentation in PHP breaks on code completion and template expansion. Steps: - Start a new PHP project - Edit the index.php, write (only) : <?php class cl { public function foo() {} public function bar() { $this->fo } } - code complete 'foo' Result: public function bar() { $this->foo() } with the code completed line having too many indentation. Expected: correct indentation. Someting similar happens when code-completing multi-line code templates. Steps: - Edit the index.php, write (only) : <?php class cl { public function foo() {} public function bar() { swi } } - template-expand that 'swi' Result: - All lines but the first are not indented. Expected: - Correct indentation based on indentation of the first line/context. This does not happen when using "Reformat Text". But I don't want to have to configure the formatting completely just to use code templates, or have normal code completion. I also think this didn't used to be the case in the 7.* version I used to use. A forum post I found that seems to have the exact same issue: https://netbeans.org/projects/www/lists/netcat/archive/2012-05/message/122
We're experiencing this exact same issue. "Reindent Text" seems to only impact the indentation of the second line of the template, ignoring any lines beyond that. The expected behavior would be that all of the lines from the template have an equal number of indenting characters added to them based on where the cursor is when the template is expanded.
It works for me properly in the current dev build. Could anyone please verify it? Thanks. Product Version: NetBeans IDE Dev (Build 20160525-db11206858f0) Java: 1.8.0_91; Java HotSpot(TM) 64-Bit Server VM 25.91-b14 Runtime: Java(TM) SE Runtime Environment 1.8.0_91-b14 System: Linux version 4.4.0-22-generic running on amd64; UTF-8; cs_CZ (nb)
I just downloaded the development version of today (201605250002). Can confirm both cases expand just fine. Will try running the development version at work for a while also. Thank to whomever.
Thanks for letting us know!