fuzzyFind callback convention.
This commit is contained in:
parent
2c00450029
commit
564592891c
|
@ -70,7 +70,7 @@ var list = blessed.list({
|
||||||
search: function(callback) {
|
search: function(callback) {
|
||||||
prompt.input('Search:', '', function(err, value) {
|
prompt.input('Search:', '', function(err, value) {
|
||||||
if (err) return;
|
if (err) return;
|
||||||
return callback(value);
|
return callback(null, value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -5133,8 +5133,12 @@ function List(options) {
|
||||||
if (typeof self.options.search !== 'function') {
|
if (typeof self.options.search !== 'function') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return self.options.search(function(value) {
|
return self.options.search(function(err, value) {
|
||||||
if (!value) return self.screen.render();
|
if (typeof err === 'string' || (err && err.test)) {
|
||||||
|
value = err;
|
||||||
|
err = null;
|
||||||
|
}
|
||||||
|
if (err || !value) return self.screen.render();
|
||||||
self.select(self.fuzzyFind(value, key.ch === '?'));
|
self.select(self.fuzzyFind(value, key.ch === '?'));
|
||||||
self.screen.render();
|
self.screen.render();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue