Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to insert completion item on PointerPressed/PointerReleased/DoubleTapped #451

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mgarstenauer
Copy link
Contributor

This PR adds an options to choose whether completion items are inserted on PointerPressed, PointerReleased or DoubleTapped.

This is an improvement on #414 and addresses the feedback by @gebodal mentioned on issue #413.

In addition, this fixes an issue where first click in the CompletionWindow is swallowed by the PopupWithCustomPosition tooltip.

/// <summary>
/// Defines the pointer action used to request the insertion of a completion item.
/// </summary>
public enum CompletionAcceptAction
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like it could be a flags enum, with a possibility to set None option at least.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current options PointerPressed/PointerReleased/DoubleTapped are mutually exclusive and can't be combined as flags.

I am not sure if we want to allow None. That would prevent users from using the mouse for insertions. I suggest to only add None if there is practical use case.

The current defaults (TextEditorOptions.CompletionAcceptAction == CompletionAcceptAction.PointerPressed) ensure that the behavior in existing apps is unchanged.

@mgarstenauer mgarstenauer force-pushed the completion-accept-action branch from 8eb3f4f to e0f0ec5 Compare December 17, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants