Brandon Gui created NETBEANS-3013:

             Summary: Allow positioning of cursor inside square braces after 
accepting a suggestion
                 Key: NETBEANS-3013
             Project: NetBeans
          Issue Type: Improvement
          Components: cnd - Code Completion
    Affects Versions: 11.1
         Environment: Windows 10 1903 (10.0.18362 Build 18362). The issue is 
reproducible without additional installed plugins.
            Reporter: Brandon Gui
         Attachments: image-2019-08-22-01-48-25-283.png, 
image-2019-08-22-01-53-04-848.png, image-2019-08-22-01-55-48-388.png, 

When accepting a suggestion with a left square bracket "[", the editor 
completes the identifier, automatically closes the bracket with a right square 
bracket "]" and places the cursor right outside the right square bracket. While 
this feature is useful, it is a nuisance when using arrays because you have to 
move the cursor back to enter the index.

The following GIF illustrates this:



However, if I were to accept the suggestion with "Enter" (which I did when I 
entered the full name of the array, but it doesn't matter if I did), entering 
the braces don't cause the cursor to be positioned outside of the right brace. 
The following GIF illustrates this:


A workaround to this issue is to remove the left square bracket "[" from the 
field of autocomplete selectors. However, hitting "[" will no longer accept 
suggestions, so you need to type the entire name of the array or select it from 
the list of suggestions manually.


Another (not-very-good) workaround is to uncheck "Insert Closing Brackets 
Automatically" instead of removing the character from the completion selectors 
field. This allows you to accept suggestions, but you'll have to manually type 
in the rest, including the closing bracket. Note that this will not only affect 
square brackets, but also parenthesis and curly braces.


This message was sent by Atlassian Jira

To unsubscribe, e-mail:
For additional commands, e-mail:

For further information about the NetBeans mailing lists, visit:

Reply via email to