* 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:
Bryan Ashby 2015-07-01 22:53:01 -06:00
parent bb7504a35a
commit 8e0dc505b1
3 changed files with 8 additions and 6 deletions

View File

@ -135,7 +135,7 @@ function ANSIEscapeParser(options) {
function parseMCI(buffer) {
// :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 match;
var mciCode;

View File

@ -47,7 +47,7 @@ function HorizontalMenuView(options) {
for(var i = 0; i < self.items.length; ++i) {
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;
}
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(
ansi.goto(self.position.row, self.items[index].col) +
ansi.goto(self.position.row, item.col) +
(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.