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