diff options
author | Ray <rayw.public@gmail.com> | 2022-01-22 08:42:48 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-22 08:42:48 +0300 |
commit | 2f1700463b328e9c19866912f6bf3efef435f0f6 (patch) | |
tree | ea985789b30a608e36360dcf4183d49c70f121e6 /doc/api/readline.md | |
parent | dbe60a23028a02d43c3b0f05e09096b23dbb36fe (diff) |
readline: add feature yank and yank pop
1. `Ctrl-Y` to yank previously deleted text
2. `Meta-Y` to do yank pop (cycle among deleted texts)
3. Use `getCursorPos().rows` to check if we have reached a new line,
instead of `getCursorPos().cols === 0`.
4. document and unittests.
PR-URL: https://github.com/nodejs/node/pull/41301
Fixes: https://github.com/nodejs/node/issues/41252
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
Diffstat (limited to 'doc/api/readline.md')
-rw-r--r-- | doc/api/readline.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/api/readline.md b/doc/api/readline.md index 4c64678fb46..7e7b06b756b 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -1314,6 +1314,16 @@ const { createInterface } = require('readline'); <td></td> </tr> <tr> + <td><kbd>Ctrl</kbd>+<kbd>Y</kbd></td> + <td>Yank (Recall) the previously deleted text</td> + <td>Only works with text deleted by <kbd>Ctrl</kbd>+<kbd>U</kbd> or <kbd>Ctrl</kbd>+<kbd>K</kbd></td> + </tr> + <tr> + <td><kbd>Meta</kbd>+<kbd>Y</kbd></td> + <td>Cycle among previously deleted lines</td> + <td>Only available when the last keystroke is <kbd>Ctrl</kbd>+<kbd>Y</kbd></td> + </tr> + <tr> <td><kbd>Ctrl</kbd>+<kbd>A</kbd></td> <td>Go to start of line</td> <td></td> |