You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<?php
class Test
{
FOO = 1
BAR = 2
BAZ = 3
// 🡤 place caret to each of the 3 lines directly above here. The intention here is to add 'const' keywords.
}
Type 'c', wait for the suggestions and then type 'o'. The result will be:
cBAZo = 1
coBAZ = 2
coBAZ = 3
Undo, then type 'c', and then accept the 'const' suggestion:
const BAZ = 1
const BAZ = 2
const BAZ = 3
Undo again and attempt to avoid the issue by avoiding the invocation of code completion: type space, then move cursor one character to the left and then type 'const'. If instead of entering 'const', a suggestion is accepted, the code gets some extra spaces, although the names remain intact:
Apache NetBeans version
Apache NetBeans 23
What happened
Whenever code complete suggestions show up while multicaret is used, the edited code is broken, see examples below.
This issue was originally reported in Jira and, I guess, overlooked during the migration to Github Issues: https://issues.apache.org/jira/browse/NETBEANS-5317
Language / Project Type / NetBeans Component
Editor
How to reproduce
Example 1:
Type 'c', wait for the suggestions and then type 'o'. The result will be:
Undo, then type 'c', and then accept the 'const' suggestion:
Undo again and attempt to avoid the issue by avoiding the invocation of code completion: type space, then move cursor one character to the left and then type 'const'. If instead of entering 'const', a suggestion is accepted, the code gets some extra spaces, although the names remain intact:
Example 2 (provided by @junichi11):
In a java file, code is broken:
p
private
It seems that this occurs when code completion is run.
Did this work correctly in an earlier version?
No / Don't know
Operating System
Windows 11
JDK
OpenJDK 64-Bit Server VM 22+36-2370
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
There are many ways to reproduce the issue, including code completion for class properties, etc.
Are you willing to submit a pull request?
No
The text was updated successfully, but these errors were encountered: