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.
Consider this code: ... ...fin.open(fileName.c_str()); ...if (fin.fail()) ......return false; | <- cursor here Hit tab ... ...fin.open(fileName.c_str()); ...if (fin.fail()) ......return false; ......| <- cursor is now here at the wrong indentation
Another example: ...for (int i = 0; i < length; i++) ......if (!inArray(data, length, intArray[i])) .........data[i] = intArray[i]; ......else .........duplicates++;| <- cursor here Hit return ...for (int i = 0; i < length; i++) ......if (!inArray(data, length, intArray[i])) .........data[i] = intArray[i]; ......else .........duplicates++; ............| <- cursor is now here Hit return ...for (int i = 0; i < length; i++) ......if (!inArray(data, length, intArray[i])) .........data[i] = intArray[i]; ......else .........duplicates++; ............ ............| <- cursor is now here
Another example: ...for (int i = 0; i < length; i++) ......if (!inArray(data, length, intArray[i])) .........data[i] = intArray[i]; ......else .........duplicates++; ...... ......| <- cursor is here Begin typing ...for (int i = 0; i < length; i++) ......if (!inArray(data, length, intArray[i])) .........data[i] = intArray[i]; ......else .........duplicates++; ...... ............c| <- cursor jumps here!
What language are you referring to? Java? C/C++? Other?
I was referring to C++. But the problem exists in Java as well. In Java, for example: ...for (int i = 0; i < length; i++) { ......if (!inArray(data, length, intArray[i])) .........data[i] = intArray[i]; ......else .........duplicates++;| <- cursor is here Hit return ...for (int i = 0; i < length; i++) { ......if (!inArray(data, length, intArray[i])) .........data[i] = intArray[i]; ......else .........duplicates++; ......| <- cursor is here (correct) However: ...for (int i = 0; i < length; i++) { ......if (!inArray(data, length, intArray[i])) .........data[i] = intArray[i]; ......else .........duplicates++; | <- cursor is here Hit tab ...for (int i = 0; i < length; i++) { ......if (!inArray(data, length, intArray[i])) .........data[i] = intArray[i]; ......else .........duplicates++; .........| <- cursor is here (wrong)
Ok, let's deal with the C++ problem first.
C/C++ problem about wrong indentation after compound statement without braces: https://netbeans.org/bugzilla/show_bug.cgi?id=177229 https://netbeans.org/bugzilla/show_bug.cgi?id=178524 https://netbeans.org/bugzilla/show_bug.cgi?id=178867 was fixed (will be in NB 6.8 patch1). First test case is a common editor problem (common for java and c/c++).
Thanks, moving to java.
I have the same problem when editing PHP code in NetBeans: ...if.(!$result || !$result["coupon_code"]) ......return.false; | <- cursor here Hit tab ...if.(!$result || !$result["coupon_code"]) ......return.false; ......| <- cursor is now here at the wrong indentation
This bug has no been addressed in 8 months. I'm moving it to PHP. Hopefully someone there will take pity and fix it for that language. Pleeeease someone fix this. :(
batch reassigning
In PHP the last case (comment #8) works in NB 7.0. Due to this bug I found out that case with object operator doesn't work. <?php class MyClass { public function compare () { if ($this->test() == 10) <- ENTER } } I have fixed this as well. If you find new case, where it doesn't work correctly, please create for it new bug.