Permalink
Browse files

[341-ctrl-l-doesnt-clear-initial-rails-output]

  • Loading branch information...
1 parent d69ef28 commit b2ebb6a84a773a5d55027da72467c8e74c7edd68 @mstepanov mstepanov committed Apr 14, 2010
@@ -115,6 +115,9 @@
* in field {@link #ansiParameters}.
*/
private int nextAnsiParameter = 0;
+
+ private int lastCursorLine = -1;
+ private int lastCursorColumn = -1;
Reader fReader;
@@ -650,6 +653,8 @@ private void processAnsiCommand_G() {
* sequence parameters (default is the upper left corner of the screen).
*/
private void processAnsiCommand_H() {
+ lastCursorLine = text.getCursorLine();
+ lastCursorColumn = text.getCursorColumn();
moveCursor(getAnsiParameter(0) - 1, getAnsiParameter(1) - 1);
}
@@ -729,7 +734,18 @@ private void processAnsiCommand_J() {
case 2:
// Erase entire display.
-
+
+ if (text.getCursorLine() == 0 && text.getCursorColumn() == 0
+ && lastCursorLine != -1 && lastCursorColumn != -1) {
+ moveCursor(lastCursorLine, lastCursorColumn);
+ for (int i = text.getLines(); i > 0; --i) {
+ text.processNewline();
+ }
+ moveCursor(0, 0);
+ lastCursorLine = -1;
+ lastCursorColumn = -1;
+
+ }
text.eraseAll();
break;

0 comments on commit b2ebb6a

Please sign in to comment.