Skip to content

Commit

Permalink
Properly constrain selection position when clicking on error message
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpoole committed Jan 25, 2025
1 parent ead8135 commit 2651c05
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ repositories {

``` groovy
dependencies {
compile "ch.poole:OpeningHoursFragment:0.14.2"
compile "ch.poole:OpeningHoursFragment:0.14.3"
}
```
2 changes: 1 addition & 1 deletion lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ apply plugin: 'signing'
apply plugin: "jacoco"
apply plugin: "com.github.breadmoirai.github-release"

version = '0.14.2'
version = '0.14.3'
def libName = "OpeningHoursFragment"

task updateTranslations(type: Exec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,8 @@ private void displayParseErrors(@NonNull OpeningHoursParseException pex) {
message.setSingleLine();
message.setText(ex.getMessage());
message.setTextColor(ContextCompat.getColor(getContext(), R.color.error_text));
final int column = ex.getColumn() + 1;
message.setOnClickListener(v -> text.setSelection(column, Math.min(column + 1, message.length())));
final int column = Math.min(ex.getColumn() + 1, message.length() - 1);
message.setOnClickListener(v -> text.setSelection(column, column));
errorMessages.addView(message);
}
}
Expand Down

0 comments on commit 2651c05

Please sign in to comment.