Skip to content

Commit

Permalink
Alternative keys for Ctrl-W and Page-Down
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenz Guenther authored and mptre committed Sep 11, 2017
1 parent 2092491 commit 7d0a568
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pick.1
Original file line number Diff line number Diff line change
Expand Up @@ -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-</Alt->
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions pick.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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"),
Expand Down
7 changes: 7 additions & 0 deletions tests/61.t
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions tests/62.t
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions tests/63.t
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7d0a568

Please sign in to comment.