Skip to content

Commit 0999d53

Browse files
cjihrigBridgeAR
authored andcommittedJan 3, 2020
repl: use public getCursorPos()
_getCursorPos() recently became public API. This commit updates the remaining uses of _getCursorPos() to use the public API. PR-URL: #31091 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 01fd3be commit 0999d53

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎lib/internal/repl/utils.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
141141

142142
function getPreviewPos() {
143143
const displayPos = repl._getDisplayPos(`${repl._prompt}${repl.line}`);
144-
const cursorPos = repl._getCursorPos();
144+
const cursorPos = repl.getCursorPos();
145145
const rows = 1 + displayPos.rows - cursorPos.rows;
146146
return { rows, cols: cursorPos.cols };
147147
}
@@ -528,7 +528,7 @@ function setupReverseSearch(repl) {
528528
rows = repl._getDisplayPos(`${repl._prompt}${line}`).rows;
529529
cursorTo(repl.output, promptPos.cols);
530530
} else if (isInReverseSearch && repl.line !== '') {
531-
rows = repl._getCursorPos().rows;
531+
rows = repl.getCursorPos().rows;
532532
cursorTo(repl.output, promptPos.cols);
533533
}
534534
if (rows !== 0)
@@ -580,7 +580,7 @@ function setupReverseSearch(repl) {
580580
if (repl.line !== '') {
581581
repl.output.write(repl.line);
582582
if (repl.line.length !== repl.cursor) {
583-
const { cols, rows } = repl._getCursorPos();
583+
const { cols, rows } = repl.getCursorPos();
584584
cursorTo(repl.output, cols);
585585
if (rows !== 0)
586586
moveCursor(repl.output, 0, rows);

0 commit comments

Comments
 (0)