@@ -117,12 +117,7 @@ extension PatternTextStyle {
117117 } none: {
118118 commit, virtuals in
119119 commit. snapshot. append ( contentsOf: virtuals, as: . phantom)
120- //=----------------------------------=
121- // Selection
122- //=----------------------------------=
123- switch virtuals. endIndex != pattern. endIndex { // real vs fake
124- case true : commit. snapshot. select ( commit. snapshot . endIndex)
125- case false : commit. snapshot. select ( commit. snapshot. startIndex) }
120+ commit. snapshot. select ( commit. snapshot. endIndex)
126121 } done: {
127122 commit, virtuals, mismatches in
128123 //=----------------------------------=
@@ -231,8 +226,18 @@ extension PatternTextStyle {
231226 // (!) None
232227 //=--------------------------------------=
233228 if pIndex == pattern. startIndex {
234- none ( & result, pattern [ pIndex ..< qIndex] )
235- pIndex = qIndex
229+ //=----------------------------------=
230+ // Placeholders == 0
231+ //=----------------------------------=
232+ if qIndex == pattern. endIndex {
233+ none ( & result, pattern [ pIndex ..< pIndex] )
234+ //=----------------------------------=
235+ // Placeholder >= 1
236+ //=----------------------------------=
237+ } else {
238+ none ( & result, pattern [ pIndex ..< qIndex] )
239+ pIndex = qIndex
240+ }
236241 }
237242 //=--------------------------------------=
238243 // (!) Done
0 commit comments