Skip to content

Commit

Permalink
fix first line null
Browse files Browse the repository at this point in the history
  • Loading branch information
wshoy committed Sep 4, 2024
1 parent 47b400f commit 4f64f31
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ public boolean onActionLongClick(final @StringRes int action) {
final int lineStart = TextViewUtils.getLineStart(text, sel[0]);
final int lineEnd = TextViewUtils.getLineEnd(text, sel[1]);
final List<TodoTxtTask> tasks = TodoTxtTask.getTasks(text, sel[0], sel[1]);
char prevPriority = '\0';
char nextPriority = '\0';
char prevPriority = '\0', nextPriority = '\0';
boolean areAllSamePriority = true;
if (lineStart != 0) {
final int prevLineStart = TextViewUtils.getLineStart(text, lineStart - 1);
Expand All @@ -230,14 +229,18 @@ public boolean onActionLongClick(final @StringRes int action) {
if(prevPriority != tasks.get(0).getPriority() && prevPriority != '\0') {
setPriority(prevPriority);
}
else if(nextPriority != tasks.get(tasks.size() - 1).getPriority() && nextPriority != '\0'){
else if(nextPriority != tasks.get(tasks.size() - 1).getPriority() && nextPriority != '\0') {
setPriority(nextPriority);
}
else {
setPriority(TodoTxtTask.PRIORITY_NONE);
}
} else {
setPriority(prevPriority);
if(prevPriority != '\0') {
setPriority(prevPriority);
} else {
setPriority(tasks.get(0).getPriority());
}
}
return true;
}
Expand Down

0 comments on commit 4f64f31

Please sign in to comment.