Skip to content

Commit e17bdd4

Browse files
committed
Update
1 parent 205c9b3 commit e17bdd4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Core/Sources/SuggestionInjector/SuggestionInjector.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,14 @@ public struct SuggestionInjector {
239239

240240
// remove the first adjacent placeholder in suffix which looks like `<#Hello#>`
241241

242-
let regex = try! NSRegularExpression(pattern: "<#.*?#>")
242+
let regex = try! NSRegularExpression(pattern: "\\s+<#.*?#>")
243243

244244
if let firstPlaceholderRange = regex.firstMatch(
245245
in: suffix,
246246
options: [],
247247
range: NSRange(suffix.startIndex..., in: suffix)
248248
)?.range,
249-
firstPlaceholderRange.location <= 1,
249+
firstPlaceholderRange.location == 0,
250250
let r = Range(firstPlaceholderRange, in: suffix)
251251
{
252252
suffix.removeSubrange(r)

0 commit comments

Comments
 (0)