]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Implement scrollPages
authorDaniel Imms <daimms@microsoft.com>
Sun, 9 Oct 2016 19:51:58 +0000 (12:51 -0700)
committerDaniel Imms <daimms@microsoft.com>
Sun, 9 Oct 2016 19:51:58 +0000 (12:51 -0700)
src/xterm.js
test/test.js

index 83592bb7d5b76ca49fe6da2db8e66ef5633d46b1..957c3b6b413e2029e7b35e63a5decae000e434d2 100644 (file)
@@ -1307,6 +1307,14 @@ Terminal.prototype.scrollDisp = function(disp, suppressScrollEvent) {
   this.refresh(0, this.rows - 1);
 };
 
+/**
+ * Scroll the display of the terminal by a number of pages.
+ * @param {number} pageCount The number of pages to scroll.
+ */
+Terminal.prototype.scrollPages = function(pageCount) {
+  this.scrollDisp(pageCount * (this.rows - 1));
+}
+
 /**
  * Writes text to the terminal.
  * @param {string} text The text to write to the terminal.
index b5dc20ecfee0ee3eb9eab54d01b4d52e1dc2515f..fc44b319902da480ab3ccd6e8d1a92a3d8fd4991 100644 (file)
@@ -88,6 +88,12 @@ describe('xterm.js', function() {
     });
   });
 
+  describe('scrollDisp', function() {
+    it('should scroll a single line', function() {
+      assert.equal(xterm.ydisp, -1);
+    });
+  });
+
   describe('evaluateKeyEscapeSequence', function() {
     it('should return the correct escape sequence for unmodified keys', function() {
       // Backspace