-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch up source api for more flexibility.
- Loading branch information
Jake Harding
committed
Aug 23, 2014
1 parent
2260576
commit 27c765e
Showing
6 changed files
with
210 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
I think that the change in this hunk introduces a bug.
To determine how many suggestions (results) to append, all that matters is the limit and the number of suggestions currently rendered. This commit changes it so that
rendered
equals the number of suggestions currently rendered PLUS the ones that were returned by the async query but have not yet been rendered. Therefore if the query yields a lot of results, none will be rendered because this calculation treats them as though they've all already been rendered.The
rendered += results.length;
line used to be after the call to_append
(which seems to be correct) but now it is before.I came across this while testing 0.11.0. With a limit of 5, if 3 results were returned, only 2 would display (because
that.limit == 5
andrendered == results.length == 3
, sothat.limit - rendered == 2). Changing it so that the
rendered += results.length;line is after the
_append` call fixes it. And FWIW all tests pass with that change and without that change.