Skip to content

Commit 53a19c2

Browse files
committed
[wavesoft#30] Make isIncompleteInput pluggable
1 parent 8d0b7f5 commit 53a19c2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/LocalEchoController.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ export default class LocalEchoController {
2626
constructor(term = null, options = {}) {
2727
this.term = term;
2828
this._handleTermData = this.handleTermData.bind(this);
29-
this._handleTermResize = this.handleTermResize.bind(this)
30-
29+
this._handleTermResize = this.handleTermResize.bind(this);
30+
3131
this.history = new HistoryController(options.historySize || 10);
3232
this.maxAutocompleteEntries = options.maxAutocompleteEntries || 100;
33+
this.isIncompleteInput = options.isIncompleteInput || isIncompleteInput;
3334

3435
this._autocompleteHandlers = [];
3536
this._active = false;
@@ -43,7 +44,6 @@ export default class LocalEchoController {
4344
};
4445

4546
this._disposables = [];
46-
4747
if (term) {
4848
if (term.loadAddon) term.loadAddon(this);
4949
else this.attach();
@@ -545,7 +545,7 @@ export default class LocalEchoController {
545545
} else if (ord < 32 || ord === 0x7f) {
546546
switch (data) {
547547
case "\r": // ENTER
548-
if (isIncompleteInput(this._input)) {
548+
if (this.isIncompleteInput(this._input)) {
549549
this.handleCursorInsert("\n");
550550
} else {
551551
this.handleReadComplete();

0 commit comments

Comments
 (0)