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
diff options
context:
space:
mode:
authorJeremy Albright <myrlin1@gmail.com>2019-11-27 23:02:02 +0300
committerMichaƫl Zasso <targos@protonmail.com>2019-12-16 13:22:25 +0300
commita68729cf3d02798ec88fffa20575074b6332ade8 (patch)
tree78b163ac3898f62b9a668007cb7cd4b385a91100 /doc
parent0007524f2d1247d2f2bb3acc3b77a62e9d63aef5 (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')
-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