Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorJeremy Albright <myrlin1@gmail.com>2019-11-27 23:02:02 +0300
committerMyles Borins <mylesborins@google.com>2019-12-18 02:21:11 +0300
commit5b49ded22a1c48d279a326fb3d147a284a1a26ab (patch)
tree6b369463759927ce3a6f99c3ed568a50551226cf /doc/api
parent13b5ace4dbcfae422fa1a1d347a4b994973987bd (diff)
readline: promote _getCursorPos to public api
Alias _getCursorPos() = getCursorPos() for backwards compatibility. Refs: https://github.com/nodejs/node/issues/30347 PR-URL: https://github.com/nodejs/node/pull/30687 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/readline.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/api/readline.md b/doc/api/readline.md
index ce63dbaa390..bae063f0b21 100644
--- a/doc/api/readline.md
+++ b/doc/api/readline.md
@@ -398,6 +398,19 @@ reading input from a TTY stream. The position of cursor determines the
portion of the input string that will be modified as input is processed,
as well as the column where the terminal caret will be rendered.
+### rl.getCursorPos()
+<!-- YAML
+added: REPLACEME
+-->
+
+* Returns: {Object}
+ * `rows` {number} the row of the prompt the cursor currently lands on
+ * `cols` {number} the screen column the cursor currently lands on
+
+Returns the real position of the cursor in relation to the input
+prompt + string. Long input (wrapping) strings, as well as multiple
+line prompts are included in the calculations.
+
## readline.clearLine(stream, dir\[, callback\])
<!-- YAML
added: v0.7.7