This commit is contained in:
Christopher Jeffrey 2015-04-23 22:25:09 -07:00
parent fdf181b8e0
commit bcb248b768
2 changed files with 11 additions and 5 deletions

View File

@ -248,15 +248,17 @@ var ANIMATING = [
function takeScreenshot(name) {
var filename = name.replace(/\//g, '.') + '.ans.sgr';
var image;
// Animating art hangs terminal during screenshot as of right now.
if (~ANIMATING.indexOf(name)) {
var sgr = blessed.element.prototype.screenshot.call(art,
image = blessed.element.prototype.screenshot.call(art,
0 - art.ileft, art.width - art.iright,
0 - art.itop, art.height - art.ibottom);
} else {
var sgr = art.screenshot();
image = art.screenshot();
}
fs.writeFileSync(__dirname + '/' + filename, sgr);
fs.writeFileSync(__dirname + '/' + filename, image);
msg.display('Screenshot taken.');
}
function slideshow() {
@ -267,9 +269,11 @@ function slideshow() {
list.enterSelected(i);
return slide;
}(), 3000);
msg.display('Slideshow started.');
} else {
clearInterval(screen._.slideshow);
delete screen._.slideshow;
msg.display('Slideshow stopped.');
}
}
@ -279,4 +283,5 @@ function shuffle() {
});
list.setItems(items);
screen.render();
msg.display('Shuffled items.');
}

View File

@ -5240,7 +5240,8 @@ function List(options) {
return;
}
return self.options.search(function(err, value) {
if (typeof err === 'string' || (err && err.test)) {
if (typeof err === 'string' || typeof err === 'function'
|| typeof err === 'number' || (err && err.test)) {
value = err;
err = null;
}
@ -5391,7 +5392,7 @@ List.prototype.fuzzyFind = function(search, back) {
for (var i = start; i >= 0; i--){
if (test(this.items[i].getText())) return i;
}
for (var i = this.ritems.length - 1; i > start; i--){
for (var i = this.items.length - 1; i > start; i--){
if (test(this.items[i].getText())) return i;
}
}