]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Merge pull request #435 from sourcelair/issue-#359-gulp
authorParis Kasidiaris <pariskasidiaris@gmail.com>
Sun, 15 Jan 2017 09:49:32 +0000 (11:49 +0200)
committerGitHub <noreply@github.com>
Sun, 15 Jan 2017 09:49:32 +0000 (11:49 +0200)
Introduce build system based on Gulp

1  2 
src/xterm.js

diff --combined src/xterm.js
index c75fbb1a8944741121cbb8f81a9b828f7e8824bc,2fcf507397dec0c77fb61341456f4da6263d8965..353b96185885edb2988af4c131d36ffe49164f86
   * @license MIT
   */
  
- import { CompositionHelper } from './CompositionHelper.js';
- import { EventEmitter } from './EventEmitter.js';
- import { Viewport } from './Viewport.js';
- import { rightClickHandler, pasteHandler, copyHandler } from './handlers/Clipboard.js';
- import { CircularList } from './utils/CircularList.js';
+ import { CompositionHelper } from './CompositionHelper';
+ import { EventEmitter } from './EventEmitter';
+ import { Viewport } from './Viewport';
+ import { rightClickHandler, pasteHandler, copyHandler } from './handlers/Clipboard';
+ import { CircularList } from './utils/CircularList';
  import { C0 } from './EscapeSequences';
- import { CharMeasure } from './utils/CharMeasure.js';
+ import { CharMeasure } from './utils/CharMeasure';
  import * as Browser from './utils/Browser';
  import * as Keyboard from './utils/Keyboard';
  
@@@ -405,24 -405,6 +405,24 @@@ Terminal.prototype.setOption = function
    if (!(key in Terminal.defaults)) {
      throw new Error('No option with key "' + key + '"');
    }
 +  switch (key) {
 +    case 'scrollback':
 +      if (this.options[key] !== value) {
 +        if (this.lines.length > value) {
 +          const amountToTrim = this.lines.length - value;
 +          const needsRefresh = (this.ydisp - amountToTrim < 0);
 +          this.lines.trimStart(amountToTrim);
 +          this.ybase = Math.max(this.ybase - amountToTrim, 0);
 +          this.ydisp = Math.max(this.ydisp - amountToTrim, 0);
 +          if (needsRefresh) {
 +            this.refresh(0, this.rows - 1);
 +          }
 +        }
 +        this.lines.maxLength = value;
 +        this.viewport.syncScrollArea();
 +      }
 +      break;
 +  }
    this[key] = value;
    this.options[key] = value;
  };
@@@ -632,7 -614,7 +632,7 @@@ Terminal.prototype.open = function(pare
    }
    this.parent.appendChild(this.element);
  
 -  this.charMeasure = new CharMeasure(this.rowContainer);
 +  this.charMeasure = new CharMeasure(this.helperContainer);
    this.charMeasure.on('charsizechanged', function () {
      self.updateCharSizeCSS();
    });
@@@ -1157,10 -1139,6 +1157,10 @@@ Terminal.prototype.refresh = function(s
      row = y + this.ydisp;
  
      line = this.lines.get(row);
 +    if (!line || !this.children[y]) {
 +      // Continue if the line is not available, this means a resize is currently in progress
 +      continue;
 +    }
      out = '';
  
      if (this.y === y - (this.ybase - this.ydisp)
      i = 0;
  
      for (; i < width; i++) {
 +      if (!line[i]) {
 +        // Continue if the character is not available, this means a resize is currently in progress
 +        continue;
 +      }
        data = line[i][0];
        ch = line[i][1];
        ch_width = line[i][2];