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 config option for instant completion entry preview. #7189

Merged
merged 1 commit into from
Jun 9, 2023
Merged

Add config option for instant completion entry preview. #7189

merged 1 commit into from
Jun 9, 2023

Conversation

luca-schlecker
Copy link
Contributor

This PR adds the config option preview_completion_insert which controls the insertion behavior of autocompletion.
Currently, Helix inserts the selected completion entry instantly into the document (reversible with c-c), this behavior is a personal preference though and should be configurable, as I prefer it to only insert on confirmation.

The new option defaults to true, thus the default behavior is not changed.

@CptPotato
Copy link
Contributor

I think somebody mentioned plans that the completion preview should use virtual text in the future, instead of inserting it as actual text until confirmed. I'm not sure if this is actively being worked on, though.

@luca-schlecker
Copy link
Contributor Author

I think somebody mentioned plans that the completion preview should use virtual text in the future, instead of inserting it as actual text until confirmed. I'm not sure if this is actively being worked on, though.

Seems like a nice addition, but it doesn't quite solve the specific problem addressed by this PR. Having the option to not preview anything at all is still different from having a virtual text without direct insertion.

@kirawi kirawi added the A-helix-term Area: Helix term improvements label Jun 5, 2023
Copy link
Member

@pascalkuthe pascalkuthe left a comment

Choose a reason for hiding this comment

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

I think somebody mentioned plans that the completion preview should use virtual text in the future, instead of inserting it as actual text until confirmed. I'm not sure if this is actively being worked on, though.

that was an idea that some people mentioned in #6594 but I don't think it's feasible. I am not sure if we want a config opinion for this we are usually a bit hesitant to introduce those. The behavior here matches VSCode/Intellij so this is pretty established behavior. Considering that the changes to get this working are quite small I would lean Towards supporting this. The implementation itself LGTM

book/src/configuration.md Outdated Show resolved Hide resolved
helix-term/src/ui/completion.rs Outdated Show resolved Hide resolved
… true).

Signed-off-by: Luca Schlecker <luca.schlecker@hotmail.com>
Copy link
Member

@dead10ck dead10ck left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

@dead10ck dead10ck merged commit dbd248f into helix-editor:master Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants