fix ACS for TERM=linux again. fix listbar .style.

This commit is contained in:
Christopher Jeffrey 2015-01-29 20:06:19 -08:00
parent 02176938c9
commit 0881128a4f
1 changed files with 22 additions and 13 deletions

View File

@ -1080,7 +1080,9 @@ Screen.prototype.draw = function(start, end) {
// supports UTF8, but I imagine it's unlikely.
// Maybe remove !this.tput.unicode check, however,
// this seems to be the way ncurses does it.
if (this.tput.strings.enter_alt_charset_mode && !this.tput.brokenACS) {
// if (this.tput.strings.enter_alt_charset_mode && !this.tput.brokenACS) {
if (this.tput.strings.enter_alt_charset_mode) {
if (!this.tput.brokenACS) {
if (this.tput.acscr[ch]) {
if (acs) {
ch = this.tput.acscr[ch];
@ -1093,6 +1095,7 @@ Screen.prototype.draw = function(start, end) {
ch = this.tput.rmacs() + ch;
acs = false;
}
}
} else {
// U8 is not consistently correct. Some terminfo's
// terminals that do not declare it may actually
@ -6052,6 +6055,14 @@ function Listbar(options) {
Box.call(this, options);
if (!this.style.selected) {
this.style.selected = {};
}
if (!this.style.item) {
this.style.item = {};
}
if (options.commands || options.items) {
this.setItems(options.commands || options.items);
}
@ -6081,7 +6092,6 @@ function Listbar(options) {
self.emit('action', self.items[self.selected], self.selected);
self.emit('select', self.items[self.selected], self.selected);
var item = self.items[self.selected];
//item.press();
if (item._.cmd.callback) {
item._.cmd.callback();
}
@ -6235,7 +6245,6 @@ Listbar.prototype.appendItem = function(item, callback) {
});
var el = new Box(options);
//var el = new Button(options);
this._[cmd.text] = el;
cmd.element = el;