Skip to content

Commit 14c1a80

Browse files
committed
Merge branch 'develop'
2 parents bad34a2 + a65f6a9 commit 14c1a80

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ allprojects {
100100

101101
```
102102
dependencies {
103-
implementation 'com.github.santalu:textmatcher:1.0.5'
103+
implementation 'com.github.santalu:textmatcher:1.0.6'
104104
}
105105
```
106106
## License

library/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ android {
88
defaultConfig {
99
minSdkVersion versions.minSdk
1010
targetSdkVersion versions.targetSdk
11-
versionCode 6
12-
versionName "1.0.5"
11+
versionCode 7
12+
versionName "1.0.6"
1313
consumerProguardFiles 'consumer-rules.pro'
1414
}
1515

library/src/main/java/com/santalu/textmatcher/TextMatcher.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,12 @@ class TextMatcher(
3333
if (!isMatchingEnabled) return
3434

3535
rules.forEach {
36-
if (text.isNullOrEmpty()) return@forEach action(it, null)
36+
if (text.isNullOrEmpty()) {
37+
action(it, null)
38+
return@forEach
39+
}
3740

38-
val position = if (before > count) start - 1 else start
41+
val position = if (start > 0 && before > count) start - 1 else start
3942

4043
// find closest target's boundaries from selection
4144
val targetStart = it.getTargetStart(text, position)

0 commit comments

Comments
 (0)