aboutsummaryrefslogtreecommitdiff
path: root/desktop-utilities/lumina-terminal/TerminalWidget.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-04-13 14:39:43 -0400
committerKen Moore <moorekou@gmail.com>2016-04-13 14:39:43 -0400
commit813aef6fadc6da2d9a356bbcc7e25d09e3a7e016 (patch)
tree7bd2da760b7705ffde7103eb955f3329b065a553 /desktop-utilities/lumina-terminal/TerminalWidget.cpp
parentGet the new terminal in a more functional state - highlight/copy/paste are no... (diff)
downloadlumina-813aef6fadc6da2d9a356bbcc7e25d09e3a7e016.tar.gz
lumina-813aef6fadc6da2d9a356bbcc7e25d09e3a7e016.tar.bz2
lumina-813aef6fadc6da2d9a356bbcc7e25d09e3a7e016.zip
Get the home/end keys functional.
Diffstat (limited to 'desktop-utilities/lumina-terminal/TerminalWidget.cpp')
-rw-r--r--desktop-utilities/lumina-terminal/TerminalWidget.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/desktop-utilities/lumina-terminal/TerminalWidget.cpp b/desktop-utilities/lumina-terminal/TerminalWidget.cpp
index 2ba4e7fa..b73b9ba3 100644
--- a/desktop-utilities/lumina-terminal/TerminalWidget.cpp
+++ b/desktop-utilities/lumina-terminal/TerminalWidget.cpp
@@ -338,9 +338,10 @@ QBrush brush = CFMT.background();
//Outgoing Data parsing
void TerminalWidget::sendKeyPress(int key){
QByteArray ba;
- QString cCol = QString::number(this->textCursor().columnNumber()); //current column number
- QString cLine = QString::number(this->document()->toPlainText().left(this->textCursor().position()).count("\n"));
- QString maxCol = QString::number( this->document()->toPlainText().section("\n",cLine.toInt(), cLine.toInt()).length()-1);
+ //QString cCol = QString::number(this->textCursor().columnNumber()); //current column number
+ //QString cLine = QString::number(this->document()->toPlainText().left(this->textCursor().position()).count("\n"));
+ //QString maxCol = QString::number( this->document()->toPlainText().section("\n",cLine.toInt(), cLine.toInt()).length()-1);
+ int fromEnd = this->document()->characterCount() - this->textCursor().position();
//Check for special keys
switch(key){
case Qt::Key_Delete:
@@ -362,12 +363,12 @@ void TerminalWidget::sendKeyPress(int key){
ba.append("\x1b[B");
break;
case Qt::Key_Home:
- ba.append( "\x1b[" ); //+cLine+";0H").toLocal8Bit().data() );
- ba.append( cLine.toLocal8Bit().data() );
- ba.append(";0H");
+ ba.append("\x1b[H");
break;
case Qt::Key_End:
- ba.append( QString("\x1b["+cLine+";"+maxCol+"H").toLocal8Bit().data() );
+ for(int i=0; i<fromEnd; i++){
+ ba.append("\x1b[C");
+ }
break;
}
bgstack15