File tree 2 files changed +4
-10
lines changed
2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -356,9 +356,9 @@ Interface.prototype.undoHistory = function() {
356
356
357
357
// If it's a multiline code, then add history
358
358
// accordingly.
359
- Interface . prototype . multilineHistory = function ( clearBuffer ) {
360
- // if not clear buffer, add multiline history
361
- if ( ! clearBuffer && this . terminal ) {
359
+ Interface . prototype . multilineHistory = function ( ) {
360
+ // check if we got a multiline code
361
+ if ( this . multiline !== '' && this . terminal ) {
362
362
const dupIndex = this . history . indexOf ( this . multiline ) ;
363
363
if ( dupIndex !== - 1 ) this . history . splice ( dupIndex , 1 ) ;
364
364
// Remove the last entered line as multiline
Original file line number Diff line number Diff line change @@ -667,13 +667,6 @@ function REPLServer(prompt,
667
667
}
668
668
}
669
669
670
- // handle multiline history
671
- if ( self [ kBufferedCommandSymbol ] . length )
672
- REPLServer . super_ . prototype . multilineHistory . call ( self , false ) ;
673
- else {
674
- REPLServer . super_ . prototype . multilineHistory . call ( self , true ) ;
675
- }
676
-
677
670
// Clear buffer if no SyntaxErrors
678
671
self . clearBufferedCommand ( ) ;
679
672
sawCtrlD = false ;
@@ -780,6 +773,7 @@ exports.start = function(prompt,
780
773
781
774
REPLServer . prototype . clearBufferedCommand = function clearBufferedCommand ( ) {
782
775
this [ kBufferedCommandSymbol ] = '' ;
776
+ REPLServer . super_ . prototype . multilineHistory . call ( this ) ;
783
777
} ;
784
778
785
779
REPLServer . prototype . close = function close ( ) {
You can’t perform that action at this time.
0 commit comments