AGI: Fix predictive input binary search
Note that there are still issues with this input mode. If the binary search hits a prefix match before finding the full match, it won't recognize the full match. (Example: typing "buy" will show "buz" because it's aiming for "buzzard" without realizing "buy" exists.)
This commit is contained in:
parent
f5c54bd9a3
commit
41ba2433f5
1 changed files with 1 additions and 1 deletions
|
@ -570,7 +570,7 @@ bool AgiEngine::matchWord() {
|
|||
int hi = _predictiveDictLineCount - 1;
|
||||
int lo = 0;
|
||||
int line = 0;
|
||||
while (lo < hi) {
|
||||
while (lo <= hi) {
|
||||
line = (lo + hi) / 2;
|
||||
int cmpVal = strncmp(_predictiveDictLine[line], _currentCode.c_str(), _currentCode.size());
|
||||
if (cmpVal > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue