Search code examples
netbeanscode-completioncode-templates

NetBeans code templates, with comments


I have following code template in NB 6.9.1:

function ${functionName}($$${param})
{
    ${selection}${cursor}
} // end: ${functionName} ()

NB formats this to:

function testFuncName($param)
{

}

// end: testFuncName ()

NB keeps to push comment from last line two linebreaks lower than ending bracket, but i want to have it exactly in line witch contains ending bracket. Any ideas?

[EDIT] This if for PHP language, env: Ubuntu 10.04


Solution

  • Adjust your code formatting options (Tools menu->options, click "Editor" at the top, click the "Formatting" tab, and set "Language" to "PHP").

    In the "Blank Lines" category, set "After Function" to zero to eliminate the blank line between the } and the comment. I'm not sure which formatting option is inserting the other newline, but you should be able to tweak the settings and figure it out.