From f1dee0d04f8b12b6ba16197534af2d0d3e4da8a5 Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Tue, 8 Jul 2008 06:42:02 +0000 Subject: [PATCH] Drop special handling of ctrl-l Drop special handling of ctrl-l in handle_interlink_event. To make sure that the 'redraw' action works everywhere, first modify menu_kbd_handler and mainmenu_kbd_handler to handle ACT_MENU_REDRAW; and second, drop the ACTION_REQUIRE_VIEW_STATE flag from the 'redraw' action in the 'main' keymap so that it works even if there is no document loaded. Ctrl-l is already bound to 'redraw' in all keymaps by default, so the current default behaviour is preserved. --- src/bfu/menu.c | 8 +++++++- src/config/actions-main.inc | 2 +- src/terminal/event.c | 6 +----- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/bfu/menu.c b/src/bfu/menu.c index c21daa9c..feacf043 100644 --- a/src/bfu/menu.c +++ b/src/bfu/menu.c @@ -937,6 +937,11 @@ menu_kbd_handler(struct menu *menu, struct term_event *ev) search_menu(menu); break; + case ACT_MENU_REDRAW: + display_menu(win->term, menu); + redraw_terminal_cls(win->term); + break; + case ACT_MENU_CANCEL: if (list_has_next(win->term->windows, win) && win->next->handler == mainmenu_handler) @@ -1296,7 +1301,8 @@ mainmenu_kbd_handler(struct menu *menu, struct term_event *ev) break; case ACT_MENU_REDRAW: - /* Just call display_mainmenu() */ + display_mainmenu(win->term, menu); + redraw_terminal_cls(win->term); break; default: diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc index 21ff838e..6620d3f2 100644 --- a/src/config/actions-main.inc +++ b/src/config/actions-main.inc @@ -82,7 +82,7 @@ ACTION_(MAIN, "open-os-shell", OPEN_OS_SHELL, N__("Open an OS shell"), ACTION_RE ACTION_(MAIN, "options-manager", OPTIONS_MANAGER, N__("Open options manager"), ACTION_RESTRICT_ANONYMOUS), ACTION_(MAIN, "quit", QUIT, N__("Open a quit confirmation dialog box"), 0), ACTION_(MAIN, "really-quit", REALLY_QUIT, N__("Quit without confirmation"), 0), -ACTION_(MAIN, "redraw", REDRAW, N__("Redraw the terminal"), ACTION_REQUIRE_VIEW_STATE), +ACTION_(MAIN, "redraw", REDRAW, N__("Redraw the terminal"), 0), ACTION_(MAIN, "reload", RELOAD, N__("Reload the current page"), 0), ACTION_(MAIN, "rerender", RERENDER, N__("Re-render the current page"), 0), ACTION_(MAIN, "reset-form", RESET_FORM, N__("Reset form items to their initial values"), ACTION_REQUIRE_VIEW_STATE | ACTION_REQUIRE_LOCATION), diff --git a/src/terminal/event.c b/src/terminal/event.c index 3a5d87f1..428add7d 100644 --- a/src/terminal/event.c +++ b/src/terminal/event.c @@ -300,11 +300,7 @@ handle_interlink_event(struct terminal *term, struct interlink_event *ilev) reset_timer(); - if (modifier == KBD_MOD_CTRL && (key == 'l' || key == 'L')) { - redraw_terminal_cls(term); - break; - - } else if (key == KBD_CTRL_C) { + if (key == KBD_CTRL_C) { destroy_terminal(term); return 0; }