Skip to content

Commit 5020b8a

Browse files
cjihrigtargos
authored andcommitted
repl: use public getCursorPos()
_getCursorPos() recently became public API. This commit updates the remaining uses of _getCursorPos() to use the public API. PR-URL: nodejs#31091 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 76f82fc commit 5020b8a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/internal/repl/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) {
142142

143143
function getPreviewPos() {
144144
const displayPos = repl._getDisplayPos(`${repl._prompt}${repl.line}`);
145-
const cursorPos = repl._getCursorPos();
145+
const cursorPos = repl.getCursorPos();
146146
const rows = 1 + displayPos.rows - cursorPos.rows;
147147
return { rows, cols: cursorPos.cols };
148148
}
@@ -529,7 +529,7 @@ function setupReverseSearch(repl) {
529529
rows = repl._getDisplayPos(`${repl._prompt}${line}`).rows;
530530
cursorTo(repl.output, promptPos.cols);
531531
} else if (isInReverseSearch && repl.line !== '') {
532-
rows = repl._getCursorPos().rows;
532+
rows = repl.getCursorPos().rows;
533533
cursorTo(repl.output, promptPos.cols);
534534
}
535535
if (rows !== 0)
@@ -581,7 +581,7 @@ function setupReverseSearch(repl) {
581581
if (repl.line !== '') {
582582
repl.output.write(repl.line);
583583
if (repl.line.length !== repl.cursor) {
584-
const { cols, rows } = repl._getCursorPos();
584+
const { cols, rows } = repl.getCursorPos();
585585
cursorTo(repl.output, cols);
586586
if (rows !== 0)
587587
moveCursor(repl.output, 0, rows);

0 commit comments

Comments
 (0)