@@ -61,7 +61,6 @@ var commands = require( './commands.js' );
61
61
var displayPrompt = require ( './display_prompt.js' ) ;
62
62
var inputPrompt = require ( './input_prompt.js' ) ;
63
63
var OutputStream = require ( './output_stream.js' ) ;
64
- var processLine = require ( './process_line.js' ) ;
65
64
var completerFactory = require ( './completer.js' ) ;
66
65
var MultilineHandler = require ( './multiline_handler.js' ) ;
67
66
var PreviewCompleter = require ( './completer_preview.js' ) ;
@@ -238,14 +237,6 @@ function REPL( options ) {
238
237
// Define the current workspace:
239
238
setNonEnumerable ( this , '_currentWorkspace' , 'base' ) ;
240
239
241
- // Initialize an internal status object for multi-line mode:
242
- setNonEnumerable ( this , '_multiline' , { } ) ;
243
- setNonEnumerable ( this . _multiline , 'active' , false ) ;
244
- setNonEnumerable ( this . _multiline , 'mode' , 'incomplete_expression' ) ;
245
- setNonEnumerable ( this . _multiline , 'line' , 0 ) ;
246
- setNonEnumerable ( this . _multiline , 'lines' , [ ] ) ;
247
- setNonEnumerable ( this . _multiline , 'buffer' , '' ) ;
248
-
249
240
// Initialize an internal flag indicating whether the REPL has been closed:
250
241
setNonEnumerable ( this , '_closed' , false ) ;
251
242
@@ -354,7 +345,7 @@ function REPL( options ) {
354
345
completed = self . _previewCompleter . beforeKeypress ( data , key ) ;
355
346
356
347
// If completion was auto-completed, don't trigger multiline keybindings to avoid double operations...
357
- if ( ! completed && self . _multiline . active ) {
348
+ if ( ! completed ) {
358
349
self . _multilineHandler . beforeKeypress ( data , key ) ;
359
350
return ;
360
351
}
@@ -395,7 +386,7 @@ function REPL( options ) {
395
386
function onLine ( line ) {
396
387
self . _SIGINT = false ; // reset flag
397
388
if ( self . _closed === false ) {
398
- processLine ( self , line ) ;
389
+ self . _multilineHandler . processLine ( line ) ;
399
390
}
400
391
}
401
392
@@ -524,19 +515,6 @@ setNonEnumerableReadOnly( REPL.prototype, '_prompt', function prompt() {
524
515
return inputPrompt ( this . _inputPrompt , this . _count ) ;
525
516
} ) ;
526
517
527
- /**
528
- * Returns the height of the current input.
529
- *
530
- * @private
531
- * @name _inputHeight
532
- * @memberof REPL.prototype
533
- * @type {Function }
534
- * @returns {number } input rows
535
- */
536
- setNonEnumerableReadOnly ( REPL . prototype , '_inputHeight' , function inputHeight ( ) {
537
- return this . _multiline . lines . length ;
538
- } ) ;
539
-
540
518
/**
541
519
* Returns the REPL viewport.
542
520
*
0 commit comments