Skip to content

Add config option for instant completion entry preview. - #7189

Merged
dead10ck merged 1 commit into
helix-editor:masterfrom
luca-schlecker:main
Jun 9, 2023
Merged

Add config option for instant completion entry preview.#7189
dead10ck merged 1 commit into
helix-editor:masterfrom
luca-schlecker:main

Conversation

@luca-schlecker

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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

@pascalkuthe pascalkuthe left a comment

Copy link
Copy Markdown
Member

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

Comment thread book/src/configuration.md Outdated
Comment thread helix-term/src/ui/completion.rs Outdated
… true).

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

@dead10ck dead10ck left a comment

Copy link
Copy Markdown
Member

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