Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-3013

Allow positioning of cursor inside square braces after accepting a suggestion



    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 11.1
    • Fix Version/s: None
    • Component/s: cnd - Code Completion
    • Labels:
    • Environment:
      Windows 10 1903 (10.0.18362 Build 18362). The issue is reproducible without additional installed plugins.


      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.


        1. image-2019-08-22-02-07-30-533.png
          309 kB
          Brandon Gui
        2. image-2019-08-22-01-55-48-388.png
          14 kB
          Brandon Gui
        3. image-2019-08-22-01-53-04-848.png
          11 kB
          Brandon Gui
        4. image-2019-08-22-01-48-25-283.png
          644 kB
          Brandon Gui



            • Assignee:
              Brandon_Gui123 Brandon Gui
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: