* Probably some throw away changes
This commit is contained in:
parent
30150dac66
commit
05af6daa8d
|
@ -373,12 +373,27 @@ function MultiLineEditTextView2(options) {
|
||||||
self.insertCharacterInText(c, index, self.cursorPos.col);
|
self.insertCharacterInText(c, index, self.cursorPos.col);
|
||||||
self.cursorPos.col++;
|
self.cursorPos.col++;
|
||||||
|
|
||||||
|
var text = self.getText(index);
|
||||||
|
var cursorOffset = 0;
|
||||||
|
|
||||||
if(self.getText(index).length >= self.dimens.width) {
|
if(self.getText(index).length >= self.dimens.width) {
|
||||||
//
|
//
|
||||||
// Scan back and find the start of the last word, then discover
|
// Scan back and find the start of the last word, then discover
|
||||||
// if the cursor is a part of that word (begin/end/mid) and if
|
// if the cursor is a part of that word (begin/end/mid) and if
|
||||||
// so, it's position relative to such.
|
// so, it's position relative to such.
|
||||||
//
|
//
|
||||||
|
for(var i = text.length; 0 !== i; i--) {
|
||||||
|
if(/\s/.test(text[i])) {
|
||||||
|
console.log(i);
|
||||||
|
if(self.cursorPos.col >= i && self.cursorPos.col <= text.length) {
|
||||||
|
i = self.cursorPos.col - i;
|
||||||
|
cursorOffset = i - 1;
|
||||||
|
console.log(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Past available space -- word wrap from current point
|
// Past available space -- word wrap from current point
|
||||||
|
@ -433,6 +448,7 @@ function MultiLineEditTextView2(options) {
|
||||||
if(self.cursorPos.col >= self.dimens.width) {
|
if(self.cursorPos.col >= self.dimens.width) {
|
||||||
console.log('next line')
|
console.log('next line')
|
||||||
self.cursorBeginOfNextLine();
|
self.cursorBeginOfNextLine();
|
||||||
|
//self.client.term.write(ansi.right(cursorOffset))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue