Skip to content

Commit

Permalink
Case insensitive completion doesn't highlight results of different ca…
Browse files Browse the repository at this point in the history
…se, fixes #249
  • Loading branch information
gnodet committed Apr 4, 2018
1 parent dffdf84 commit 644fefe
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4649,7 +4649,8 @@ else if (items instanceof List) {
if (cand == selection) {
out[1] = i;
sb.style(getCompletionStyleSelection());
if (left.toString().startsWith(completed)) {
if (left.toString().regionMatches(
isSet(Option.CASE_INSENSITIVE), 0, completed, 0, completed.length())) {
sb.append(left.toString(), 0, completed.length());
sb.append(left.toString(), completed.length(), left.length());
} else {
Expand All @@ -4663,7 +4664,8 @@ else if (items instanceof List) {
}
sb.style(AttributedStyle.DEFAULT);
} else {
if (left.toString().startsWith(completed)) {
if (left.toString().regionMatches(
isSet(Option.CASE_INSENSITIVE), 0, completed, 0, completed.length())) {
sb.style(getCompletionStyleStarting());
sb.append(left, 0, completed.length());
sb.style(AttributedStyle.DEFAULT);
Expand Down

0 comments on commit 644fefe

Please sign in to comment.