From ab4c0e0954d797ad6ac46652261ebcab55cd5adc Mon Sep 17 00:00:00 2001 From: Patrick Hallen Date: Wed, 11 Feb 2009 20:30:22 +0100 Subject: [PATCH] command: Added the new jump command. Added the new jump command, which queries the user for a string and jumps to the entry which begins with that string while the user is typing. --- NEWS | 2 ++ doc/keys.sample | 3 +++ src/command.c | 5 +++++ src/command.h | 1 + src/screen_help.c | 1 + 5 files changed, 12 insertions(+) diff --git a/NEWS b/NEWS index 221bf7a..cd74dc3 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,7 @@ ncmpc 0.14 - not yet released * bell on wrapped search (optionally) + * added new "jump" ('.') command, which queries the user for a string and + jumps to the entry which begins with that string while the user is typing. ncmpc 0.13 - 2009-01-09 diff --git a/doc/keys.sample b/doc/keys.sample index 1b9e586..61b7b73 100644 --- a/doc/keys.sample +++ b/doc/keys.sample @@ -134,6 +134,9 @@ key rfind = 63 ## Backward find previous key rfind-next = 'p' +## Jump to +key jump = '.' + ## Key configuration screen #key screen-keyedit = 'K' diff --git a/src/command.c b/src/command.c index 4558414..ad8b8d4 100644 --- a/src/command.c +++ b/src/command.c @@ -190,6 +190,11 @@ static command_definition_t cmds[] = { N_("Backward find") }, { { 'p', 0, 0 }, 0, CMD_LIST_RFIND_NEXT, "rfind-next", N_("Backward find previous") }, + { { '.', 0, 0 }, 0, CMD_LIST_JUMP, "jump", + /* translators: this queries the user for a string + * and jumps directly (while the user is typing) + * to the entry which begins with this string */ + N_("Jump to") }, /* extra screens */ diff --git a/src/command.h b/src/command.h index f339910..7111a2b 100644 --- a/src/command.h +++ b/src/command.h @@ -67,6 +67,7 @@ typedef enum { CMD_LIST_FIND_NEXT, CMD_LIST_RFIND, CMD_LIST_RFIND_NEXT, + CMD_LIST_JUMP, CMD_LIST_MOVE_UP, CMD_LIST_MOVE_DOWN, CMD_LIST_VISUAL_SELECT, diff --git a/src/screen_help.c b/src/screen_help.c index 8a33de3..f8438dc 100644 --- a/src/screen_help.c +++ b/src/screen_help.c @@ -84,6 +84,7 @@ static help_text_row_t help_text[] = { { 0, CMD_LIST_RFIND, NULL }, { 0, CMD_LIST_FIND_NEXT, NULL }, { 0, CMD_LIST_RFIND_NEXT, NULL }, + { 0, CMD_LIST_JUMP, NULL }, { 0, CMD_TOGGLE_FIND_WRAP, NULL }, { 0, CMD_LOCATE, NULL }, { 0, CMD_VIEW, NULL }, -- 2.30.2