@@ -144,7 +144,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) { |
144 | 144 | let escaped = null; |
145 | 145 |
|
146 | 146 | function getPreviewPos() { |
147 | | - const displayPos = repl._getDisplayPos(`${repl._prompt}${repl.line}`); |
| 147 | + const displayPos = repl._getDisplayPos(`${repl.getPrompt()}${repl.line}`); |
148 | 148 | const cursorPos = repl.line.length !== repl.cursor ? |
149 | 149 | repl.getCursorPos() : |
150 | 150 | displayPos; |
@@ -177,7 +177,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) { |
177 | 177 | rows = pos.displayPos.rows - pos.cursorPos.rows; |
178 | 178 | moveCursor(repl.output, 0, rows); |
179 | 179 | } |
180 | | - const totalLine = `${repl._prompt}${repl.line}${completionPreview}`; |
| 180 | + const totalLine = `${repl.getPrompt()}${repl.line}${completionPreview}`; |
181 | 181 | const newPos = repl._getDisplayPos(totalLine); |
182 | 182 | // Minimize work for the terminal. It is enough to clear the right part of |
183 | 183 | // the current line in case the preview is visible on a single line. |
@@ -263,7 +263,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) { |
263 | 263 | } |
264 | 264 | repl.output.write(result); |
265 | 265 | cursorTo(repl.output, cursorPos.cols); |
266 | | - const totalLine = `${repl._prompt}${repl.line}${suffix}`; |
| 266 | + const totalLine = `${repl.getPrompt()}${repl.line}${suffix}`; |
267 | 267 | const newPos = repl._getDisplayPos(totalLine); |
268 | 268 | const rows = newPos.rows - cursorPos.rows - (newPos.cols === 0 ? 1 : 0); |
269 | 269 | moveCursor(repl.output, 0, -rows); |
@@ -611,7 +611,7 @@ function setupReverseSearch(repl) { |
611 | 611 | let rows = 0; |
612 | 612 | if (lastMatch !== -1) { |
613 | 613 | const line = repl.history[lastMatch].slice(0, lastCursor); |
614 | | - rows = repl._getDisplayPos(`${repl._prompt}${line}`).rows; |
| 614 | + rows = repl._getDisplayPos(`${repl.getPrompt()}${line}`).rows; |
615 | 615 | cursorTo(repl.output, promptPos.cols); |
616 | 616 | } else if (isInReverseSearch && repl.line !== '') { |
617 | 617 | rows = repl.getCursorPos().rows; |
@@ -631,7 +631,7 @@ function setupReverseSearch(repl) { |
631 | 631 |
|
632 | 632 | // To know exactly how many rows we have to move the cursor back we need the |
633 | 633 | // cursor rows, the output rows and the input rows. |
634 | | - const prompt = repl._prompt; |
| 634 | + const prompt = repl.getPrompt(); |
635 | 635 | const cursorLine = `${prompt}${outputLine.slice(0, cursor)}`; |
636 | 636 | const cursorPos = repl._getDisplayPos(cursorLine); |
637 | 637 | const outputPos = repl._getDisplayPos(`${prompt}${outputLine}`); |
@@ -682,7 +682,7 @@ function setupReverseSearch(repl) { |
682 | 682 | if (!isInReverseSearch) { |
683 | 683 | if (key.ctrl && checkAndSetDirectionKey(key.name)) { |
684 | 684 | historyIndex = repl.historyIndex; |
685 | | - promptPos = repl._getDisplayPos(`${repl._prompt}`); |
| 685 | + promptPos = repl._getDisplayPos(`${repl.getPrompt()}`); |
686 | 686 | print(repl.line, `${labels[dir]}_`); |
687 | 687 | isInReverseSearch = true; |
688 | 688 | } |
|