We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 205c9b3 commit e17bdd4Copy full SHA for e17bdd4
Core/Sources/SuggestionInjector/SuggestionInjector.swift
@@ -239,14 +239,14 @@ public struct SuggestionInjector {
239
240
// remove the first adjacent placeholder in suffix which looks like `<#Hello#>`
241
242
- let regex = try! NSRegularExpression(pattern: "<#.*?#>")
+ let regex = try! NSRegularExpression(pattern: "\\s+<#.*?#>")
243
244
if let firstPlaceholderRange = regex.firstMatch(
245
in: suffix,
246
options: [],
247
range: NSRange(suffix.startIndex..., in: suffix)
248
)?.range,
249
- firstPlaceholderRange.location <= 1,
+ firstPlaceholderRange.location == 0,
250
let r = Range(firstPlaceholderRange, in: suffix)
251
{
252
suffix.removeSubrange(r)
0 commit comments