Skip to content

Commit

Permalink
[textinput] Fix implementation of the kCmdWordTo{Lower,Upper} edito…
Browse files Browse the repository at this point in the history
…r commands

These commands, binded respectively to `ESC l` and `ESC u`, should
{lower,upper}case the next word; however, only the first character was changed.

Fixes root-project#10136.
  • Loading branch information
jalopezg-git committed Mar 16, 2022
1 parent 97df647 commit 4421056
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/textinput/src/textinput/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,15 @@ namespace textinput {
size_t posWord = FindWordBoundary(1);
if (M == kCmdWordToUpper) {
for (size_t i = Cursor; i < posWord; ++i) {
Line[Cursor] = toupper(Line[Cursor]);
Line[i] = toupper(Line[i]);
}
} else {
for (size_t i = Cursor; i < posWord; ++i) {
Line[Cursor] = tolower(Line[Cursor]);
Line[i] = tolower(Line[i]);
}
}
R.fEdit.Extend(Range(Cursor, posWord - Cursor));
R.fDisplay.Extend(Range(Cursor, posWord - Cursor));
R.fEdit.Extend(Range(Cursor, posWord));
R.fDisplay.Extend(Range(Cursor, posWord));
fContext->SetCursor(posWord);
return kPRSuccess;
}
Expand Down

0 comments on commit 4421056

Please sign in to comment.