Commit 0a31149
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: #41301
Fixes: #41252
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>1 parent 81e039f commit 0a31149Copy full SHA for 0a31149
File tree
Expand file treeCollapse file tree
3 files changed
+155
-1
lines changedOpen diff view settings
Filter options
- doc/api
- lib/internal/readline
- test/parallel
Expand file treeCollapse file tree
3 files changed
+155
-1
lines changedOpen diff view settings
Collapse file
+10Lines changed: 10 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1313 | 1313 | |
1314 | 1314 | |
1315 | 1315 | |
| 1316 | + |
| 1317 | + |
| 1318 | + |
| 1319 | + |
| 1320 | + |
| 1321 | + |
| 1322 | + |
| 1323 | + |
| 1324 | + |
| 1325 | + |
1316 | 1326 | |
1317 | 1327 | |
1318 | 1328 | |
|
Collapse file
lib/internal/readline/interface.js
Copy file name to clipboardExpand all lines: lib/internal/readline/interface.js+74-1Lines changed: 74 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
81 | 81 | |
82 | 82 | |
83 | 83 | |
| 84 | + |
| 85 | + |
| 86 | + |
84 | 87 | |
85 | 88 | |
86 | 89 | |
| ||
96 | 99 | |
97 | 100 | |
98 | 101 | |
| 102 | + |
| 103 | + |
99 | 104 | |
100 | 105 | |
101 | 106 | |
102 | 107 | |
103 | 108 | |
104 | 109 | |
| 110 | + |
105 | 111 | |
106 | 112 | |
107 | 113 | |
| ||
118 | 124 | |
119 | 125 | |
120 | 126 | |
| 127 | + |
| 128 | + |
| 129 | + |
121 | 130 | |
122 | 131 | |
123 | 132 | |
| ||
211 | 220 | |
212 | 221 | |
213 | 222 | |
| 223 | + |
| 224 | + |
| 225 | + |
| 226 | + |
| 227 | + |
| 228 | + |
| 229 | + |
| 230 | + |
| 231 | + |
214 | 232 | |
215 | 233 | |
216 | 234 | |
| ||
606 | 624 | |
607 | 625 | |
608 | 626 | |
| 627 | + |
609 | 628 | |
610 | 629 | |
| 630 | + |
611 | 631 | |
612 | | - |
| 632 | + |
613 | 633 | |
614 | 634 | |
615 | 635 | |
| ||
792 | 812 | |
793 | 813 | |
794 | 814 | |
| 815 | + |
795 | 816 | |
796 | 817 | |
| 818 | + |
797 | 819 | |
798 | 820 | |
799 | 821 | |
800 | 822 | |
801 | 823 | |
| 824 | + |
802 | 825 | |
| 826 | + |
803 | 827 | |
804 | 828 | |
805 | 829 | |
| 830 | + |
| 831 | + |
| 832 | + |
| 833 | + |
| 834 | + |
| 835 | + |
| 836 | + |
| 837 | + |
| 838 | + |
| 839 | + |
| 840 | + |
| 841 | + |
| 842 | + |
| 843 | + |
| 844 | + |
| 845 | + |
| 846 | + |
| 847 | + |
| 848 | + |
| 849 | + |
| 850 | + |
| 851 | + |
| 852 | + |
| 853 | + |
| 854 | + |
| 855 | + |
| 856 | + |
| 857 | + |
| 858 | + |
| 859 | + |
| 860 | + |
| 861 | + |
| 862 | + |
| 863 | + |
| 864 | + |
| 865 | + |
806 | 866 | |
807 | 867 | |
808 | 868 | |
| ||
984 | 1044 | |
985 | 1045 | |
986 | 1046 | |
| 1047 | + |
| 1048 | + |
| 1049 | + |
| 1050 | + |
| 1051 | + |
987 | 1052 | |
988 | 1053 | |
989 | 1054 | |
| ||
1094 | 1159 | |
1095 | 1160 | |
1096 | 1161 | |
| 1162 | + |
| 1163 | + |
| 1164 | + |
| 1165 | + |
1097 | 1166 | |
1098 | 1167 | |
1099 | 1168 | |
| ||
1158 | 1227 | |
1159 | 1228 | |
1160 | 1229 | |
| 1230 | + |
| 1231 | + |
| 1232 | + |
| 1233 | + |
1161 | 1234 | |
1162 | 1235 | |
1163 | 1236 | |
|
Collapse file
test/parallel/test-readline-interface.js
Copy file name to clipboardExpand all lines: test/parallel/test-readline-interface.js+71Lines changed: 71 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
674 | 674 | |
675 | 675 | |
676 | 676 | |
| 677 | + |
| 678 | + |
| 679 | + |
| 680 | + |
| 681 | + |
| 682 | + |
| 683 | + |
| 684 | + |
| 685 | + |
| 686 | + |
| 687 | + |
| 688 | + |
| 689 | + |
| 690 | + |
| 691 | + |
| 692 | + |
| 693 | + |
| 694 | + |
| 695 | + |
| 696 | + |
| 697 | + |
| 698 | + |
| 699 | + |
| 700 | + |
| 701 | + |
| 702 | + |
| 703 | + |
| 704 | + |
| 705 | + |
| 706 | + |
| 707 | + |
| 708 | + |
| 709 | + |
| 710 | + |
| 711 | + |
| 712 | + |
| 713 | + |
| 714 | + |
| 715 | + |
| 716 | + |
| 717 | + |
| 718 | + |
| 719 | + |
| 720 | + |
| 721 | + |
| 722 | + |
| 723 | + |
| 724 | + |
| 725 | + |
| 726 | + |
| 727 | + |
| 728 | + |
| 729 | + |
| 730 | + |
| 731 | + |
| 732 | + |
| 733 | + |
| 734 | + |
| 735 | + |
| 736 | + |
| 737 | + |
| 738 | + |
| 739 | + |
| 740 | + |
| 741 | + |
| 742 | + |
| 743 | + |
| 744 | + |
| 745 | + |
| 746 | + |
| 747 | + |
677 | 748 | |
678 | 749 | |
679 | 750 | |
|
0 commit comments