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

feat: accept-all option for autocomplete #2187

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

AllanChain
Copy link
Contributor

By default, when inputting LaTeX commands, accepting suggestion is done by [Tab] (accept-suggestion), and exiting to math mode is done by [Enter] (accept).

This PR adds a accpet-all option to autocomplete, which does both accept-suggestion and accept. If there are no suggestions, only accept is done. This allows users to bind keys to accept suggestion and exit latex mode at the same time, which is convenient. (which is also consistent with LyX if you know it)

This allows user to bind keys to accept suggestion and
exit latex mode at the same time, which is convenient.
@arnog
Copy link
Owner

arnog commented Nov 29, 2023

Thanks for the PR. That's an interesting idea.

Do you think a default keybinding should use that option?

@arnog arnog merged commit f7d8076 into arnog:master Nov 29, 2023
1 of 2 checks passed
@AllanChain
Copy link
Contributor Author

AllanChain commented Nov 29, 2023

While I'm conservative for behavior changes, I personally appreciate the "Tab to cycle and Enter to accept and exit to math" way.

And I have to point out that if it is made default, there are some rare edge cases where the user intended \al (just an example) and the suggestions only list \aleph etc., and the user is impossible to input \al.

BTW, I'm developing and using MathLive plugin for Logseq, where the user can always change the keybinding using the config file. Therefore whether enabling this by default will not make much difference for me.

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