If one snippet has an abbreviation that's part of another abbreviation, part of the abbreviation of one snippet will be added with the expanded text of the other snippet. To reproduce:
Enable "Auto expand snippets as they are typed" Create the following snippets with these abbreviations and text
Abbr | Text |
---|---|
snp1 | First snippet |
snp2 | Different text |
chk | ✓ |
gchk | ✅ |
Note: The black check with chk
is UTF8 character \u2713,
The green check (which may appear as a check in a box, font depending) is UTF8
character \u2705
This is what happens when I use each abbreviation:
snp1 and snp2 expand correctly on Plasma and Budgie (in a text editor)
'chk' expands correctly in gedit on Budgie, but adds a 4 on Plasma in KWrite:
✓ 4
'gchk' on Plasma in KWrite expands to
g✓4
(so it adds the g from the abbr. and then the text of the other snippet)
In gedit / Writer on Budgie 'gchk' expands to
g✓
That same green check expands correctly with this snippet:
abbr text
okc - ok ✅
I can reproduce the problem whereby if an abbreviation ends with another shorter abbreviation, the shorter end abbreviation expands, e.g, with these 2 snippets:
"w`" => "World"
"hw`" => "Hello, World"
Typing "hw`" results in "hWorld" instead of the expected "Hello, World".
That's definitely not how it's supposed to work, it should recognise that there's a longer matching abbreviation and expand that.
Thanks for the bug report (I'll trim out the UTF8 stuff as that's covered by #19).
Ian M. Jones referenced this ticket in commit b6f9a10.
This will be in Snippet Expander v1.1.0.
Here's a little demo: https://youtu.be/KClKlQcNDC8
Thanks for the bug report ~traceyc.