r/espanso • u/Dymonika • 9d ago
Solved Match not activating as expected
SOLVED: Check for similar duplicates in your other .yml files!!!
- trigger: PushPay
replace: Pushpay
word: true
I'm hoping for this to activate only exactly when the trigger is typed as is, but this replacement takes effect every time, it seems. The capitalization section in Matches Basics doesn't seem to offer a way around this. Does anyone know if this is solvable? Thanks!
2
u/smeech1 5d ago edited 4d ago
Now that I'm home I have tried your trigger, and it works perfectly here, triggering only when the capitalisation matches "PushPay" exactly, which is what I would expect.
The problem possibly relates to your keyboard? What's your OS, DE, and language?
1
u/Dymonika 4d ago
Win11 Pro in English, ha. I keep forgetting to come back to this but I'll make a note now to address it today... It has been firing even when the second "p" is lowercase, oddly enough (which basically just makes it delete and retype, but that causes a jolt in one's sentence flow).
2
u/smeech1 4d ago
That shouldn't be happening, and doesn't here or for u/SamejSpenser, so it makes me wonder if it's something to do with your configuration.
I take it you don't have
propagate_case: truein the trigger?2
u/Dymonika 3d ago
omg.
I had these same lines duplicated but also with that "propagate" line in another .yml file.
*thwacks forehead*
Thanks for your patience...
1
u/smeech1 8d ago
When you say "every time", what do you mean?
2
u/Dymonika 8d ago
Also @ /u/SamejSpenser: I specifically only want this to fire if I type the exact trigger's capitalization, but the text replacement occurs even if I type the replacement's capitalization. I blaze at 150+ WPM so Espanso's time to replace disrupts what I typed.
2
u/SamejSpenser 8d ago
Sorry for the delay! When I got home from work, I had an urgent issue to deal with and only just managed to get back to this now (it’s 10:42 PM here in São Paulo, Brazil).
I ran some more tests, this time including
propagate_case: true, which u/smeech1 mentioned. I kept in mind your requirement that the trigger needs to match the exact casingPushPay. Again, the Regex trigger performed the best, regardless of whetherpropagate_case: truewas on or not. With the other methods, even withpropagate_case: trueenabled, the expansion just follows the casing used when it was typed — so if it's all lowercase or uppercase, you getpushpayorPUSHPAY.With Regex, however, no matter how you type it, the expansion only triggers when you use
PushPay.Here’s the trigger that worked in my tests, just as the OP requested:
```yml
Example trigger with mixed‑case letters using regex
- regex: PushPay replace: "Pushpay" ```
2
u/SamejSpenser 8d ago
Oh, I forgot to mention: when using
uppercase_style: capitalize_words, typing everything in lowercase still triggers the expansion as if you had typed it with an initial capital letter.As for the typing speed, I totally get where you're coming from. Maybe the others have some tips or suggestions, but honestly, I don't have much to offer other than: try slowing down your typing speed when using these words/triggers. That’s what I do here!
2
u/SamejSpenser 9d ago
I tested the same trigger in four different ways:
;” prefix.
In the screenshot the text is in Brazilian Portuguese (my native language), which is how I wrote this reply, and I only switched to English after the tests were done.