1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Add backspace-prefix to the main map, to backspace the last entered

digit of the prefix.
This commit is contained in:
Miciah Dashiel Butler Masters 2006-04-14 21:55:42 +00:00 committed by Miciah Dashiel Butler Masters
parent 90f71fe6e4
commit 8adb976885
3 changed files with 23 additions and 0 deletions

View File

@ -10,6 +10,7 @@ ACTION_(MAIN, "add-bookmark", ADD_BOOKMARK, N__("Add a new bookmark"), ACTION_RE
ACTION_(MAIN, "add-bookmark-link", ADD_BOOKMARK_LINK, N__("Add a new bookmark using current link"), ACTION_RESTRICT_ANONYMOUS | ACTION_JUMP_TO_LINK | ACTION_REQUIRE_LINK),
ACTION_(MAIN, "add-bookmark-tabs", ADD_BOOKMARK_TABS, N__("Bookmark all open tabs"), ACTION_RESTRICT_ANONYMOUS),
ACTION_(MAIN, "auth-manager", AUTH_MANAGER, N__("Open authentication manager"), 0),
ACTION_(MAIN, "backspace-prefix", BACKSPACE_PREFIX, N__("Backspace the last entered digit of the current prefix"), ACTION_REQUIRE_VIEW_STATE),
ACTION_(MAIN, "bookmark-manager", BOOKMARK_MANAGER, N__("Open bookmark manager"), 0),
ACTION_(MAIN, "cache-manager", CACHE_MANAGER, N__("Open cache manager"), 0),
ACTION_(MAIN, "cache-minimize", CACHE_MINIMIZE, N__("Free unused cache entries"), 0),

View File

@ -660,6 +660,7 @@ static struct default_kb default_main_keymap[] = {
{ { '{', KBD_MOD_NONE }, ACT_MAIN_SCROLL_LEFT },
{ { '|', KBD_MOD_NONE }, ACT_MAIN_HEADER_INFO },
{ { '}', KBD_MOD_NONE }, ACT_MAIN_SCROLL_RIGHT },
{ { KBD_BS, KBD_MOD_NONE }, ACT_MAIN_BACKSPACE_PREFIX },
{ { KBD_DEL, KBD_MOD_NONE }, ACT_MAIN_SCROLL_DOWN },
{ { KBD_DOWN, KBD_MOD_NONE }, ACT_MAIN_MOVE_LINK_NEXT },
{ { KBD_END, KBD_MOD_NONE }, ACT_MAIN_MOVE_DOCUMENT_END },

View File

@ -127,6 +127,27 @@ do_action(struct session *ses, enum main_action action_id, int verbose)
auth_manager(ses);
break;
case ACT_MAIN_BACKSPACE_PREFIX:
if (!ses->kbdprefix.repeat_count) break;
/* Clear the highlighting. */
draw_formatted(ses, 0);
ses->kbdprefix.repeat_count /= 10;
if (ses->kbdprefix.repeat_count)
highlight_links_with_prefixes_that_start_with_n(
term, doc_view,
ses->kbdprefix.repeat_count);
print_screen_status(ses);
/* Keep send_event from resetting repeat_count. */
status = FRAME_EVENT_SESSION_DESTROYED;
break;
case ACT_MAIN_BOOKMARK_MANAGER:
#ifdef CONFIG_BOOKMARKS
bookmark_manager(ses);