mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-22 00:39:04 +00:00
minor.
This commit is contained in:
parent
fdf181b8e0
commit
bcb248b768
@ -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.');
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user