diff --git a/Makefile.am b/Makefile.am index 1b592332..82a2c26f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,8 @@ TESTS=tests/01.t tests/02.t tests/03.t tests/04.t tests/05.t tests/06.t \ tests/37.t tests/38.t tests/39.t tests/40.t tests/41.t tests/42.t \ tests/43.t tests/44.t tests/45.t tests/46.t tests/47.t tests/48.t \ tests/49.t tests/50.t tests/51.t tests/52.t tests/53.t tests/54.t \ - tests/55.t tests/56.t tests/57.t tests/58.t tests/59.t tests/60.t + tests/55.t tests/56.t tests/57.t tests/58.t tests/59.t tests/60.t \ + tests/61.t tests/62.t tests/63.t TEST_EXTENSIONS=.t T_LOG_COMPILER=$(top_srcdir)/tests/pick-test.sh AM_COLOR_TESTS=no diff --git a/pick.1 b/pick.1 index 53f2ac24..06774638 100644 --- a/pick.1 +++ b/pick.1 @@ -54,7 +54,7 @@ Exit with a erroneous status without outputting the selected choice. Redraw interface with respect to the current size of the terminal. .It Ic Up/Down | Ctrl-P/Ctrl-N Select between choices matching the current search query. -.It Ic Page-Down/Page-Up | Ctrl-V/Alt-V +.It Ic Page-Down/Page-Up | Ctrl-V/Alt-V | Alt-Space Move the selection to the choice located one page down/up from the currently selected choice. .It Ic Home/End | Alt- @@ -73,7 +73,7 @@ Move the cursor to the end of the line in the search query input field. Delete one character to the left of the cursor in the search query input field. .It Ic Delete | Ctrl-D Delete the character under the cursor in the search query input field. -.It Ic Ctrl-W +.It Ic Ctrl-W | Alt-Backspace Delete the word to the left of the cursor. A word is recognized as a sequence of characters for which either .Xr isalnum 3 diff --git a/pick.c b/pick.c index d96876fc..a1c52720 100644 --- a/pick.c +++ b/pick.c @@ -897,6 +897,8 @@ get_key(const char **key) KEY(CTRL_L, "\014"), KEY(CTRL_U, "\025"), KEY(CTRL_W, "\027"), + KEY(CTRL_W, "\033\177"), + KEY(CTRL_W, "\033\b"), CAP(DEL, "kdch1"), KEY(DEL, "\004"), CAP(END, "kend"), @@ -912,6 +914,7 @@ get_key(const char **key) KEY(LINE_UP, "\020"), CAP(PAGE_DOWN, "knp"), KEY(PAGE_DOWN, "\026"), + KEY(PAGE_DOWN, "\033 "), CAP(PAGE_UP, "kpp"), KEY(PAGE_UP, "\033v"), CAP(RIGHT, "kcuf1"), diff --git a/tests/61.t b/tests/61.t new file mode 100644 index 00000000..ecb31091 --- /dev/null +++ b/tests/61.t @@ -0,0 +1,7 @@ +description: Alt-Backspace alias CTRL_W +keys: aa\\ Åå \033\b aa\\ aa \n # CTRL_W ENTER +stdin: +aa Åå aa +aa Åå aa aa +stdout: +aa Åå aa aa diff --git a/tests/62.t b/tests/62.t new file mode 100644 index 00000000..b07ab993 --- /dev/null +++ b/tests/62.t @@ -0,0 +1,7 @@ +description: Alt-Backspace alias CTRL_W +keys: aa\\ Åå \033\177 aa\\ aa \n # CTRL_W ENTER +stdin: +aa Åå aa +aa Åå aa aa +stdout: +aa Åå aa aa diff --git a/tests/63.t b/tests/63.t new file mode 100644 index 00000000..88883d00 --- /dev/null +++ b/tests/63.t @@ -0,0 +1,11 @@ +description: Alt-Space alias for PAGE_DOWN +keys: \033\\ \n # PAGE_DOWN ENTER +env: LINES=5 +stdin: +01 +02 +03 +04 +05 +stdout: +05