Commit Graph

4 Commits

Author SHA1 Message Date
Ray
2f1700463b
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>
2022-01-22 05:42:48 +00:00
Ray
271725a363
readline: undo previous edit when get key code 0x1F
1. Undo previous edit on keystroke `ctrl -` (emit 0x1F)
2. unittests
3. documentation

PR-URL: https://github.com/nodejs/node/pull/41392
Fixes: https://github.com/nodejs/node/issues/41308
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-01-21 10:24:06 +00:00
Ruben Bridgewater
bbed2a77d3
readline: skip escaping characters again
This is a minor performance improvement for readline. It skips to
escape individual characters again after escaping them before.

Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de>

PR-URL: https://github.com/nodejs/node/pull/41005
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-12-01 01:50:34 +00:00
Antoine du Hamel
592d1c3d44 readline: refactor Interface to ES2015 class
PR-URL: https://github.com/nodejs/node/pull/37947
Fixes: https://github.com/nodejs/node/issues/37287
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2021-09-16 23:16:34 +02:00