* Try to handle socket error

* Fix bug in wrapping with MultiLineEditText
* Updates on message base DB layout/triggers
* Detect some terminals via ANSI DSR for device attributes (WIP)
This commit is contained in:
Bryan Ashby 2015-07-06 22:37:11 -06:00
parent 2b963ce6f9
commit 40e0b55424
7 changed files with 83 additions and 11 deletions

View file

@ -392,8 +392,9 @@ function MultiLineEditTextView(options) {
var absPos;
if(self.getTextLength(index) > self.dimens.width) {
console.log('textLen=' + self.getTextLength(index) + ' / ' + self.dimens.width + ' / ' +
JSON.stringify(self.getAbsolutePosition(self.cursorPos.row, self.cursorPos.col)))
//console.log('textLen=' + self.getTextLength(index) + ' / ' + self.dimens.width + ' / ' +
// JSON.stringify(self.getAbsolutePosition(self.cursorPos.row, self.cursorPos.col)))
//
// Update word wrapping and |cursorOffset| if the cursor
// was within the bounds of the wrapped text
@ -408,22 +409,27 @@ function MultiLineEditTextView(options) {
self.redrawRows(self.cursorPos.row, self.dimens.height);
if(!_.isUndefined(cursorOffset)) {
console.log('cursorOffset=' + cursorOffset)
//console.log('cursorOffset=' + cursorOffset)
self.cursorBeginOfNextLine();
self.cursorPos.col += cursorOffset;
self.client.term.rawWrite(ansi.right(cursorOffset));
} else {
//console.log('this path')
self.moveClientCusorToCursorPos();
/*
self.cursorPos.row++;
self.cursorPos.col = 1; // we just added 1 char
absPos = self.getAbsolutePosition(self.cursorPos.row, self.cursorPos.col);
console.log('absPos=' + JSON.stringify(absPos))
self.client.term.rawWrite(ansi.goto(absPos.row, absPos.col));
*/
}
} else {
//
// We must only redraw from col -> end of current visible line
//
console.log('textLen=' + self.getTextLength(index))
//console.log('textLen=' + self.getTextLength(index))
absPos = self.getAbsolutePosition(self.cursorPos.row, self.cursorPos.col);
self.client.term.write(
ansi.hideCursor() +