@@ -147,7 +147,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
147
147
let escaped = null ;
148
148
149
149
function getPreviewPos ( ) {
150
- const displayPos = repl . _getDisplayPos ( `${ repl . _prompt } ${ repl . line } ` ) ;
150
+ const displayPos = repl . _getDisplayPos ( `${ repl . getPrompt ( ) } ${ repl . line } ` ) ;
151
151
const cursorPos = repl . line . length !== repl . cursor ?
152
152
repl . getCursorPos ( ) :
153
153
displayPos ;
@@ -180,7 +180,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
180
180
rows = pos . displayPos . rows - pos . cursorPos . rows ;
181
181
moveCursor ( repl . output , 0 , rows ) ;
182
182
}
183
- const totalLine = `${ repl . _prompt } ${ repl . line } ${ completionPreview } ` ;
183
+ const totalLine = `${ repl . getPrompt ( ) } ${ repl . line } ${ completionPreview } ` ;
184
184
const newPos = repl . _getDisplayPos ( totalLine ) ;
185
185
// Minimize work for the terminal. It is enough to clear the right part of
186
186
// the current line in case the preview is visible on a single line.
@@ -266,7 +266,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
266
266
}
267
267
repl . output . write ( result ) ;
268
268
cursorTo ( repl . output , cursorPos . cols ) ;
269
- const totalLine = `${ repl . _prompt } ${ repl . line } ${ suffix } ` ;
269
+ const totalLine = `${ repl . getPrompt ( ) } ${ repl . line } ${ suffix } ` ;
270
270
const newPos = repl . _getDisplayPos ( totalLine ) ;
271
271
const rows = newPos . rows - cursorPos . rows - ( newPos . cols === 0 ? 1 : 0 ) ;
272
272
moveCursor ( repl . output , 0 , - rows ) ;
@@ -614,7 +614,7 @@ function setupReverseSearch(repl) {
614
614
let rows = 0 ;
615
615
if ( lastMatch !== - 1 ) {
616
616
const line = repl . history [ lastMatch ] . slice ( 0 , lastCursor ) ;
617
- rows = repl . _getDisplayPos ( `${ repl . _prompt } ${ line } ` ) . rows ;
617
+ rows = repl . _getDisplayPos ( `${ repl . getPrompt ( ) } ${ line } ` ) . rows ;
618
618
cursorTo ( repl . output , promptPos . cols ) ;
619
619
} else if ( isInReverseSearch && repl . line !== '' ) {
620
620
rows = repl . getCursorPos ( ) . rows ;
@@ -634,7 +634,7 @@ function setupReverseSearch(repl) {
634
634
635
635
// To know exactly how many rows we have to move the cursor back we need the
636
636
// cursor rows, the output rows and the input rows.
637
- const prompt = repl . _prompt ;
637
+ const prompt = repl . getPrompt ( ) ;
638
638
const cursorLine = `${ prompt } ${ outputLine . slice ( 0 , cursor ) } ` ;
639
639
const cursorPos = repl . _getDisplayPos ( cursorLine ) ;
640
640
const outputPos = repl . _getDisplayPos ( `${ prompt } ${ outputLine } ` ) ;
@@ -685,7 +685,7 @@ function setupReverseSearch(repl) {
685
685
if ( ! isInReverseSearch ) {
686
686
if ( key . ctrl && checkAndSetDirectionKey ( key . name ) ) {
687
687
historyIndex = repl . historyIndex ;
688
- promptPos = repl . _getDisplayPos ( `${ repl . _prompt } ` ) ;
688
+ promptPos = repl . _getDisplayPos ( `${ repl . getPrompt ( ) } ` ) ;
689
689
print ( repl . line , `${ labels [ dir ] } _` ) ;
690
690
isInReverseSearch = true ;
691
691
}
0 commit comments