From 5020b8a16d86a63faf7c24b4ca14ef3aaba4e888 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Wed, 25 Dec 2019 09:18:20 -0500 Subject: [PATCH] repl: use public getCursorPos() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _getCursorPos() recently became public API. This commit updates the remaining uses of _getCursorPos() to use the public API. PR-URL: https://github.com/nodejs/node/pull/31091 Reviewed-By: Anna Henningsen Reviewed-By: Michaƫl Zasso Reviewed-By: Ruben Bridgewater --- lib/internal/repl/utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/repl/utils.js b/lib/internal/repl/utils.js index 20b95151dd7a3b..4da23e096c95ed 100644 --- a/lib/internal/repl/utils.js +++ b/lib/internal/repl/utils.js @@ -142,7 +142,7 @@ function setupPreview(repl, contextSymbol, bufferSymbol, active) { function getPreviewPos() { const displayPos = repl._getDisplayPos(`${repl._prompt}${repl.line}`); - const cursorPos = repl._getCursorPos(); + const cursorPos = repl.getCursorPos(); const rows = 1 + displayPos.rows - cursorPos.rows; return { rows, cols: cursorPos.cols }; } @@ -529,7 +529,7 @@ function setupReverseSearch(repl) { rows = repl._getDisplayPos(`${repl._prompt}${line}`).rows; cursorTo(repl.output, promptPos.cols); } else if (isInReverseSearch && repl.line !== '') { - rows = repl._getCursorPos().rows; + rows = repl.getCursorPos().rows; cursorTo(repl.output, promptPos.cols); } if (rows !== 0) @@ -581,7 +581,7 @@ function setupReverseSearch(repl) { if (repl.line !== '') { repl.output.write(repl.line); if (repl.line.length !== repl.cursor) { - const { cols, rows } = repl._getCursorPos(); + const { cols, rows } = repl.getCursorPos(); cursorTo(repl.output, cols); if (rows !== 0) moveCursor(repl.output, 0, rows);