apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.59k stars 833 forks source link

Add automatic closing of the menu IntelliSense. #4942

Open korenevskiy opened 1 year ago

korenevskiy commented 1 year ago

Apache NetBeans version

Apache NetBeans 15

What happened

I noticed that the cursor in the text editor is not moving correctly. (PHP) The point is that when you write text, the context menu for substituting functions and fields opens. It's good. BUT! when you add the menu command, it interferes. I.e. when the menu is open, then pressing the cursor arrows Up, Down the cursor moves up and down the menu. But if you press left to right, the cursor blocks typing altogether. You have to press Esc every time. There is no such behavior in any editor. Pressing the Left and Right arrow keys should close the context menu without pressing Esc. What do you think, why can't they fix it?

How to reproduce

When writing the code, after entering each character, the context menu opens. When the menu is open, pressing the LEFT and RIGHT arrow (Home,End) keys cannot close the context menu. The menu should be closed automatically when the cursor buttons are pressed, which do not affect the selection of a position in the open menu. The Home and End buttons should also close the menu automatically.

Did this work correctly in an earlier version?

Apache NetBeans 15

Operating System

Windows 11

JDK

18

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

When typing, the menu opens automatically, but it may not open in principle. The idea is that the menu is open or not open, it should not affect the typing, and the open menu should not block the cursor arrows Left, Right, Home,End. Because it is difficult to predict the behavior of the editor when you expect that the left and right arrows will work, but suddenly the menu opens and blocks the cursor in the text, But the menu may not appear, and then it is generally difficult to understand when it will appear and when it will not appear.

Are you willing to submit a pull request?

Yes

Code of Conduct

Yes

neilcsmith-net commented 1 year ago

Pressing left or right arrows shouldn't close the code completion - it's rather important behaviour for filtering results. I've never noticed it affecting the ability to continue typing - that would be a concern.

It's been a while since I've used PHP support. In Java support the code completion is a little less eager to appear. You could try changing the settings under Tools / Options / Editor / Code Completion for PHP - change the auto popup from all possible situations to customize and see if that helps.

cc/ @junichi11 thoughts?

junichi11 commented 1 year ago

Pressing left or right arrows shouldn't close the code completion - it's rather important behaviour for filtering results. I've never noticed it affecting the ability to continue typing - that would be a concern.

Agree.

korenevskiy commented 1 year ago

@neilcsmith-net @junichi11 Excuse me. I was wrong. The left and right arrows do not affect code editing. BUT! I got it mixed up. And this problem is completely relevant for the Home, End buttons. When typing, I often press Home, End. Since it turns out that if the menu pops up, the Home End will not work with the text, and if there is no menu, then these buttons move the cursor to the beginning of the line.

korenevskiy commented 1 year ago

@neilcsmith-net @junichi11 No, I found another problem. I was completely right. The arrow buttons stop working when you press Ctrl+Left and Ctrl+Right. When typing, I press Ctrl to jump one word to the left. I have to press Esc every time. It seemed to me that the problem was only in the arrows. But as you can see, the problem is relevant.

korenevskiy commented 1 year ago

@neilcsmith-net @junichi11 What do you think about the fact that the arrows do not work when the Ctrl key is pressed, as well as Home, End do not work?

korenevskiy commented 1 year ago

@neilcsmith-net @junichi11 Please, I need your support. What do you think about these problems?