mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-12 12:39:31 +02:00
* Some work on backspace processign with tabs... WIP.
This commit is contained in:
parent
2c7527bbcd
commit
d2244ba028
1 changed files with 24 additions and 13 deletions
|
@ -290,14 +290,12 @@ function MultiLineEditTextView2(options) {
|
||||||
|
|
||||||
self.cursorPos.col -= count;
|
self.cursorPos.col -= count;
|
||||||
|
|
||||||
// recalc to next eol
|
|
||||||
|
|
||||||
self.updateTextWordWrap(index);
|
self.updateTextWordWrap(index);
|
||||||
|
|
||||||
self.redrawRows(self.cursorPos.row, self.dimens.height);
|
self.redrawRows(self.cursorPos.row, self.dimens.height);
|
||||||
|
|
||||||
if(self.cursorPos.col < 0) {
|
if(0 === self.cursorPos.col) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
var absPos = self.getAbsolutePosition(self.cursorPos.row, self.cursorPos.col);
|
var absPos = self.getAbsolutePosition(self.cursorPos.row, self.cursorPos.col);
|
||||||
self.client.term.write(ansi.goto(absPos.row, absPos.col));
|
self.client.term.write(ansi.goto(absPos.row, absPos.col));
|
||||||
|
@ -710,16 +708,29 @@ function MultiLineEditTextView2(options) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.keyPressBackspace = function() {
|
this.keyPressBackspace = function() {
|
||||||
var count;
|
if(self.cursorPos.col > 1) {
|
||||||
if('\t' === self.getCharacter(self.cursorPos.col)) {
|
//
|
||||||
// :TODO: Need to remove tabs...
|
// Don't want to delete character at cursor, but rather the character
|
||||||
}
|
// to the left of the cursor!
|
||||||
|
//
|
||||||
|
self.cursorPos.col -= 1;
|
||||||
|
|
||||||
self.removeCharactersFromText(
|
var index = self.getTextLinesIndex();
|
||||||
self.getTextLinesIndex(),
|
var count;
|
||||||
self.cursorPos.col,
|
|
||||||
'left',
|
if('\t' === self.getCharacter(index, self.cursorPos.col)) {
|
||||||
1);
|
// :TODO: This isn't right... need to find how many up to count to actually remove
|
||||||
|
count = (self.cursorPos.col - self.getPrevTabStop(self.cursorPos.col));
|
||||||
|
} else {
|
||||||
|
count = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.removeCharactersFromText(
|
||||||
|
index,
|
||||||
|
self.cursorPos.col,
|
||||||
|
'left',
|
||||||
|
count);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.keyPressDel = function() {
|
this.keyPressDel = function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue