Skip to content

Commit

Permalink
use charAt() because length() is number of chars
Browse files Browse the repository at this point in the history
  • Loading branch information
fluentfuture committed Feb 9, 2025
1 parent 23c3a7a commit 28c5478
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ public String toString() {
// Find the full line surrounding the placeholder.
int snippetStart = match.index();
int snippetEnd = match.index() + match.length();
while (snippetStart > 0 && context.codePointAt(snippetStart - 1) != '\n') {
while (snippetStart > 0 && context.charAt(snippetStart - 1) != '\n') {
snippetStart--;
}
while (snippetEnd < context.length() && context.codePointAt(snippetEnd) != '\n') {
while (snippetEnd < context.length() && context.charAt(snippetEnd) != '\n') {
snippetEnd++;
}

Expand Down

0 comments on commit 28c5478

Please # to comment.