[ 
https://issues.apache.org/jira/browse/NETBEANS-5317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17278135#comment-17278135
 ] 

Junichi Yamamoto edited comment on NETBEANS-5317 at 2/3/21, 4:34 PM:
---------------------------------------------------------------------

Maybe, this is an editor's bug.
In a java file, code is broken:

{code:java}
public final class Example {
    // ^ is caret
     ^test1;
     ^test2;
     ^test3;
}
{code}

1. type `p`
2. run code completion ([Ctrl] + [Space]) complete `private`
3. the result is following

{code:java}
public final class Example {
    // ^ is caret
    private test3^;
    private test3^;
    private ^test3;
}
{code}

It seems that this occurs when code completion is run.



was (Author: junichi11):
Maybe, this is an editor's bug.
In a java file, code is broken:

{code:java}
public final class Example {
    // ^ is caret
     ^test1;
     ^test2;
     ^test3;
}
{code}

1. type `p`
2. run code completion ([Ctrl] + [Space])
3. the result is following

{code:java}
public final class Example {
    // ^ is caret
    private test3^;
    private test3^;
    private ^test3;
}
{code}

It seems that this occurs when code completion is run.


> Autocomplete interferes with multicaret
> ---------------------------------------
>
>                 Key: NETBEANS-5317
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-5317
>             Project: NetBeans
>          Issue Type: Bug
>          Components: editor - Completion & Templates, editor - Painting 
> & Printing
>    Affects Versions: 12.0, 12.1, 12.2, 12.3
>            Reporter: Czukowski
>            Priority: Minor
>
> Suppose you want to introduce some constants into a class and you can copy 
> that list somewhere and paste it into the class to work on:
> {code:java}
> <?php
> class Test
> {
>       FOO = 1
>       BAR = 2
>       BAZ = 3
> //    🡤 place caret to each of the 3 lines directly above here
> }
> {code}
> This is invalid code, but it should be very easy to place a caret in front of 
> each line, type {{const}}, jump to the end of the lines and finish it off 
> with a semicolon.
> However if you don't type fast enough and autocomplete suggestions appear, 
> then whether you accept a suggestion or continue typing, the code gets broken.
> Here's what happens if I type 'c', wait for the suggestions and continue with 
> typing 'o':
> {code:java}
>       cBAZo = 1
>       coBAZ = 2
>       coBAZ = 3
> {code}
> Here's what happens if I type 'c', and then accept the 'const' suggestion:
> {code:java}
>       const BAZ = 1
>       const BAZ = 2
>       const BAZ = 3
> {code}
> A possible workaround is to type space, then move cursor one character to the 
> left and then type 'const'. If instead of typing a whole 'const', a 
> suggestion is accepted, the code gets some extra spaces, although the names 
> remain intact:
> {code:java}
>       const  FOO = 1
>       const  BAR = 2
>       const BAZ = 3
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to