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

[BUG] Automatic expansion doesn't work properly with diacritics #276

Open
chances190 opened this issue Mar 17, 2024 · 0 comments
Open

[BUG] Automatic expansion doesn't work properly with diacritics #276

chances190 opened this issue Mar 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@chances190
Copy link

chances190 commented Mar 17, 2024

Description

Any automatic expansion snippet triggered by a character wil also trigger when a diacritic is input simultaneously with the character (for example ^+2 instead of ^+space+2). In addition, it will not replace that character.

Any automatic expansion snippet triggered by a diacritic followed by a character won't trigger when they're input at the same time.

To Reproduce

{trigger: "ab", replacement: "c", options: "A"} will trigger with "^b", which it shouldn't, and will result in "cb" instead of "c".
{trigger: "(\\w|\\d)(\\w|\\d)", replacement: "c", options: "rA"} will also trigger and result in "c[[1]]" instead of "c".
{trigger: "ba", replacement: "c", options: "A"} works as intended and won't trigger when inputting "bâ"

{trigger: "^2", replacement: "c", options: "A"} won't trigger when input sequence is ^+2, but triggers correctly with ^+space+2.
{trigger: "\\^(\\w|\\d)", replacement: "c", options: "rA"} also won't trigger.

Expected Behavior

Diacritics followed by characters that don't support diacritics should be treated as a sequential input (diacritic then character), and should not trigger snippets that don't include that diacritic.
When a snippet involves a diacritic, it should trigger even if that diacritic is input simultaneously as other character.

Additional context

I use an ABNT-2 keyboard and it's usual for me to input powers like "^2" by pressing first the ^ key, then the number key, without placing the "^" directly in the text. This breaks the auto subscript snippet {trigger: "([A-Za-z])(\\d)", replacement: "[[0]]_{[[1]]}", options: "rmA", priority: -1}, resulting in "x_{2}2" even tough it shouldn't've been triggered. I've had to work around by making this snippet manual because it's annoying to have to write powers pressing space.

@chances190 chances190 added the bug Something isn't working label Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant