Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 63f173b

Browse filesBrowse files
committed
Prepared code for 0.8.0 release
1 parent 91cd20a commit 63f173b
Copy full SHA for 63f173b

File tree

Expand file treeCollapse file tree

3 files changed

+7
-3
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+7
-3
lines changed

‎CHANGELOG.md

Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
### Fixed
77
- scientific notation numbers highlight length
88
- redundant keyword highlights in strings and comments
9+
- ambiguous nested forEach returns
910

1011
## [0.7.1]
1112

‎src/commonMain/kotlin/dev/snipme/highlights/internal/locator/NumericLiteralLocator.kt

Copy file name to clipboardExpand all lines: src/commonMain/kotlin/dev/snipme/highlights/internal/locator/NumericLiteralLocator.kt
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ internal object NumericLiteralLocator {
3131
} // Find start of literals
3232
.forEach { number ->
3333
// For given literal find all occurrences
34-
code.indicesOf(number).forEach { startIndex ->
34+
val indices = code.indicesOf(number)
35+
for (startIndex in indices) {
36+
// TODO Correct this and publish
3537
if (code.isFullNumber(number, startIndex).not()) return@forEach
3638
// Omit in the middle of text, probably variable name (this100)
3739
if (code.isNumberFirstIndex(startIndex).not()) return@forEach

‎src/commonMain/kotlin/dev/snipme/highlights/internal/locator/PunctuationLocator.kt

Copy file name to clipboardExpand all lines: src/commonMain/kotlin/dev/snipme/highlights/internal/locator/PunctuationLocator.kt
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package dev.snipme.highlights.internal.locator
22

3-
import dev.snipme.highlights.model.PhraseLocation
43
import dev.snipme.highlights.internal.SyntaxTokens.PUNCTUATION_CHARACTERS
54
import dev.snipme.highlights.internal.SyntaxTokens.TOKEN_DELIMITERS
65
import dev.snipme.highlights.internal.indicesOf
6+
import dev.snipme.highlights.model.PhraseLocation
77

88
internal object PunctuationLocator {
99
fun locate(code: String): List<PhraseLocation> {
@@ -14,7 +14,8 @@ internal object PunctuationLocator {
1414
.filter { it.isNotBlank() }
1515
.filter { it in PUNCTUATION_CHARACTERS }
1616
.forEach {
17-
code.indicesOf(it, ).forEach { index ->
17+
val indices = code.indicesOf(it)
18+
for (index in indices) {
1819
if (code[index].isWhitespace()) return@forEach
1920
locations.add(PhraseLocation(index, index + 1))
2021
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.