mirror of
https://github.com/nuintun/command-manager.git
synced 2025-12-15 07:05:38 +08:00
update files
This commit is contained in:
33
static/js/terminal/lib/csi/scroll.js
Normal file
33
static/js/terminal/lib/csi/scroll.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Created by nuintun on 2015/11/25.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function (Terminal){
|
||||
// CSI Ps S Scroll up Ps lines (default = 1) (SU).
|
||||
Terminal.prototype.scrollUp = function (params){
|
||||
var param = params[0] || 1;
|
||||
|
||||
while (param--) {
|
||||
this.lines.splice(this.ybase + this.scrollTop, 1);
|
||||
this.lines.splice(this.ybase + this.scrollBottom, 0, this.blankLine());
|
||||
}
|
||||
|
||||
this.updateRange(this.scrollTop);
|
||||
this.updateRange(this.scrollBottom);
|
||||
};
|
||||
|
||||
// CSI Ps T Scroll down Ps lines (default = 1) (SD).
|
||||
Terminal.prototype.scrollDown = function (params){
|
||||
var param = params[0] || 1;
|
||||
|
||||
while (param--) {
|
||||
this.lines.splice(this.ybase + this.scrollBottom, 1);
|
||||
this.lines.splice(this.ybase + this.scrollTop, 0, this.blankLine());
|
||||
}
|
||||
|
||||
this.updateRange(this.scrollTop);
|
||||
this.updateRange(this.scrollBottom);
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user