Open jakub300 opened 5 months ago
Hi, This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps. Thanks for helping out.
@WunderBart, have you seen this issue?
Thanks for the ping, @Mamaduka. I'll be able to take a look next week unless someone else beats me up to it!
Description
We use autocomplete triggers that are overlapping, specifically
@
and@@
, each triggering different type of suggestions. After one of the recent WP updates this is no longer working.Issue is most likely related to refactor in #55301. That PR changed logic from finding first matching trigger on the list within distance of the cursor, to finding closest trigger to the cursor. If we take
@@hello
as an example, beginning of single@
will always be closest to the cursor and@@
trigger will always be ignored. The possible fix is to look at the index after trigger (trigger index + trigger length) rather than trigger index. in such case the index would be the same for both triggers and first of them would be used.Step-by-step reproduction instructions
@hello
and@@hello
Screenshots, screen recording, code snippet
Environment info
Not working in WP 6.5.3, was working in WP 6.4.3.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes