Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

[Bug]: Unwanted auto insertion #1201

Closed
2 tasks done
gituser1000000 opened this issue Aug 11, 2023 · 2 comments
Closed
2 tasks done

[Bug]: Unwanted auto insertion #1201

gituser1000000 opened this issue Aug 11, 2023 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@gituser1000000
Copy link

What happened?

Unwanted auto insertion

Example:
-Write:
new View.OnClickListener() {

-A closing curly brace is automatically added, and the cursor is now in between the braces. The auto completion popup also appears.

If we now press ENTER, we would see this:
new View.OnClickListener() {}/*
*
*/

It looks like a "block comment" snippet (which happens to be the first item on the auto completion list) has been added.

What's the expected behavior?

It should show this after pressing ENTER:
new View.OnClickListener() {

}

What version of AndroidIDE you're using?

v2.5.2 (debug builds)

Relevant log output

No response

Duplicate issues

  • This issue has not been reported yet.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@gituser1000000 gituser1000000 added the bug Something isn't working label Aug 11, 2023
@itsaky
Copy link
Member

itsaky commented Aug 12, 2023

The editor does not check whether the user is using a physical or virtual keyboard and selects the first completion item when Enter key is pressed. Source.

However, this can be fixed in the IDE itself (by properly implementing the select() method in EditorCompletionWindow). I'll work on this later.

@itsaky itsaky added this to the v2.6.1-beta milestone Nov 11, 2023
@itsaky itsaky closed this as completed in 525fa5e Nov 14, 2023
@gituser1000001
Copy link

gituser1000001 commented Nov 14, 2023

It was actually nice to be able to just press enter for the first selection in most cases. It made auto completion faster to do without having to move your hand up to select an item. I understand we need to pick the best way.

What do you think of the idea of leaving it as before but just not showing the auto completion popup when the user types pair characters such as (), {}, [], <>, ', ", ... Why does it show the popup for those characters anyway when we don't even have a keyword or identifier that starts with one of those, right?

EDIT:
I just realized the auto completion pops up only if I use the buttons from the quick symbols bar. If I use the {} from the onscreen keyboard, the auto completion popup doesn't show up and pressing enter after that works just fine.

So, could we have it auto pick the first selection when using the onscreen keyboard just as before, and only fix the buttons on the quick symbols bar so that they don't show the auto completion popup after some symbols?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants