Skip to content

Commit 0999d53

Browse files
cjihrigBridgeAR
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: #31091 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 01fd3be commit 0999d53

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎lib/internal/repl/utils.js‎

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

142142
functiongetPreviewPos(){
143143
constdisplayPos=repl._getDisplayPos(`${repl._prompt}${repl.line}`);
144-
constcursorPos=repl._getCursorPos();
144+
constcursorPos=repl.getCursorPos();
145145
constrows=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
}elseif(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)