diff --git a/src/ChangeLog b/src/ChangeLog index 77bdc1790..ff428fcf7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2002-12-25 Pavel Roskin + * main.c (copy_prog_name): Make static. + (midnight_callback): Handle both Alt-Enter and Ctrl-Enter before + the widgets, because the input widget interprets them now. + (default_map): Remove Alt-Enter, it's handled elsewhere. + * key.c (correct_key_code): Convert Shift-Tab and Ctrl-Tab to Back Tab (used in dialogs to jump to the previous widget). diff --git a/src/main.c b/src/main.c index 1e14702df..0e51093a3 100644 --- a/src/main.c +++ b/src/main.c @@ -1319,9 +1319,8 @@ copy_other_readlink (void) copy_readlink (opanel); } -/* Inserts the selected file name into the input line */ -/* Exported so that the command modules uses it */ -void +/* Insert the selected file name into the input line */ +static void copy_prog_name (void) { char *tmp; @@ -1469,8 +1468,6 @@ static const key_map default_map[] = { {KEY_F (20), (key_callback) quiet_quit_cmd}, /* Copy useful information to the command line */ - {ALT ('\n'), copy_prog_name}, - {ALT ('\r'), copy_prog_name}, {ALT ('a'), copy_current_pathname}, {ALT ('A'), copy_other_pathname}, @@ -1741,14 +1738,14 @@ midnight_callback (struct Dlg_head *h, int id, int msg) if (id == '\t') free_completions (cmdline); - /* Ctrl-Enter */ - if (id == ('\n' | KEY_M_CTRL)) { - copy_prog_name (); + if (id == '\n' && cmdline->buffer[0]) { + send_message ((Widget *) cmdline, WIDGET_KEY, id); return MSG_HANDLED; } - if (id == '\n' && cmdline->buffer[0]) { - send_message ((Widget *) cmdline, WIDGET_KEY, id); + /* Ctrl-Enter and Alt-Enter */ + if ((id & ~(KEY_M_CTRL | KEY_M_ALT)) == '\n') { + copy_prog_name (); return MSG_HANDLED; } diff --git a/src/main.h b/src/main.h index 30c2616b5..9cb40a6bd 100644 --- a/src/main.h +++ b/src/main.h @@ -126,7 +126,6 @@ void change_panel (void); void init_sigchld (void); /* For subshell.c */ int load_prompt (int fd, void *unused); void save_cwds_stat (void); -void copy_prog_name (void); int quiet_quit_cmd (void); /* For cmd.c and command.c */ void untouch_bar (void);