Skip to content
Myr

Fix missing bonus score on a delimiter character

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #3645

authored by Junegunn Choi · committed by Junegunn Choi · parent edee2b7 · Browse files · 1 file+10 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−5 removed

  • other:+10 added−5 removed

1 file+10 added−5 removed

modified:src/algo/algo.go+10 added-5 removed
253 unmodified lines
254}255256func bonusFor(prevClass charClass, class charClass) int16 {257 if class > charNonWord {258 if prevClass == charWhite {258 switch prevClass {259 case charWhite:260 // Word boundary after whitespace261 return bonusBoundaryWhite261 } else if prevClass == charDelimiter {262 case charDelimiter:263 // Word boundary after a delimiter character264 return bonusBoundaryDelimiter264 } else if prevClass == charNonWord {265 case charNonWord:266 // Word boundary267 return bonusBoundary268 }269 }270271 if prevClass == charLower && class == charUpper ||272 prevClass != charNumber && class == charNumber {273 // camelCase letter123274 return bonusCamel123273 } else if class == charNonWord {275 }276277 switch class {278 case charNonWord, charDelimiter:279 return bonusNonWord275 } else if class == charWhite {280 case charWhite:281 return bonusBoundaryWhite282 }283 return 0284}
667 unmodified lines