* Fix bug in MCI parsing with lower case alpha character such as 'f' for fIRST lETTER text styles
* Minor fixes
This commit is contained in:
parent
bb7504a35a
commit
8e0dc505b1
|
@ -135,7 +135,7 @@ function ANSIEscapeParser(options) {
|
||||||
|
|
||||||
function parseMCI(buffer) {
|
function parseMCI(buffer) {
|
||||||
// :TODO: move this to "constants" seciton @ top
|
// :TODO: move this to "constants" seciton @ top
|
||||||
var mciRe = /\%([A-Z]{2})([0-9]{1,2})?(?:\(([0-9A-Z,]+)\))*/g;
|
var mciRe = /\%([A-Z]{2})([0-9]{1,2})?(?:\(([0-9A-Za-z,]+)\))*/g;
|
||||||
var pos = 0;
|
var pos = 0;
|
||||||
var match;
|
var match;
|
||||||
var mciCode;
|
var mciCode;
|
||||||
|
|
|
@ -47,7 +47,7 @@ function HorizontalMenuView(options) {
|
||||||
|
|
||||||
for(var i = 0; i < self.items.length; ++i) {
|
for(var i = 0; i < self.items.length; ++i) {
|
||||||
self.items[i].col = col;
|
self.items[i].col = col;
|
||||||
col += spacer.length + self.items[i].length + spacer.length;
|
col += spacer.length + self.items[i].text.length + spacer.length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,14 +62,16 @@ function HorizontalMenuView(options) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var text = strUtil.stylizeString(item.text, item.focused ? self.focusTextStyle : self.textStyle);
|
var text = strUtil.stylizeString(
|
||||||
|
item.text,
|
||||||
|
this.hasFocus && item.focused ? self.focusTextStyle : self.textStyle);
|
||||||
|
|
||||||
var extraPad = self.getSpacer().length * 2;
|
var drawWidth = text.length + self.getSpacer().length * 2; // * 2 = sides
|
||||||
|
|
||||||
self.client.term.write(
|
self.client.term.write(
|
||||||
ansi.goto(self.position.row, self.items[index].col) +
|
ansi.goto(self.position.row, item.col) +
|
||||||
(index === self.focusedItemIndex ? self.getFocusSGR() : self.getSGR()) +
|
(index === self.focusedItemIndex ? self.getFocusSGR() : self.getSGR()) +
|
||||||
strUtil.pad(text, text.length + extraPad, self.fillChar, 'center')
|
strUtil.pad(text, drawWidth, self.fillChar, 'center')
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue