Which is certainly not intended behavior. This bug stems from the searchSnippet method used to find matches. This is because each search will return multiple matches for each word of a multi-word lhs. For example, with "a new line |+| anl", the search results will contain three matches: "a", "new", and "line". Hastily I just had the search use the first match to the last and replace all of that selection, but evidently if the lhs occurs earlier in the line it will replace all up to the first instance of the lhs.
This should be fixable by actually scanning backwards and matching with the snippet lhs in reverse.
If you have
a |+| b
and the following text:Triggering the snippet will give you:
Which is certainly not intended behavior. This bug stems from the searchSnippet method used to find matches. This is because each search will return multiple matches for each word of a multi-word lhs. For example, with "a new line |+| anl", the search results will contain three matches: "a", "new", and "line". Hastily I just had the search use the first match to the last and replace all of that selection, but evidently if the lhs occurs earlier in the line it will replace all up to the first instance of the lhs.
This should be fixable by actually scanning backwards and matching with the snippet lhs in reverse.