Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed sloppy code for tabcompletion. #39

Merged
merged 1 commit into from
Apr 1, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $(document).ready(function(){
var pattern = ""; //text fragment respective pattern to look for
var candidate = ""; //candidate
var source = []; //array of values to be matched
var sourcePos = 0; //the search sartting position
var sourcePos = 0; //the search starting position
//-

window.counter = 0;
Expand Down Expand Up @@ -615,16 +615,17 @@ $(document).ready(function(){
});

var incrementalSearch = function(pattern, source, sp) {
result = "";
var result = "";
var r = 0;
for (var i = sp; i < source.length; i++) {
var r = source[i].search(pattern);
r = source[i].search(pattern);
sourcePos = (i+1 > source.length-1) ? 0 : i+1;
if (r == 0) {
return source[i];
}
}
for (var i = 0; i < sp; i++) {
var r = source[i].search(pattern);
r = source[i].search(pattern);
sourcePos = i+1;
if (r == 0) {
return source[i];
Expand Down