Ticket #3664: 001-3664-don-t-hardcode-X-enter.patch

File 001-3664-don-t-hardcode-X-enter.patch, 4.3 KB (added by mooffie, 8 years ago)
  • lib/keybind.c

    From e7f44662e8f4763fa43126ac5f77a9c4edc5226e Mon Sep 17 00:00:00 2001
    From: Mooffie <mooffie@gmail.com>
    Date: Sun, 17 Jul 2016 18:23:17 +0300
    Subject: [PATCH 1/2] Ticket #3664: (midnight_callback): don't hardcode
     alt-enter, ctrl-enter, ctrl-shift-enter.
    
    ---
     lib/keybind.c              |  2 ++
     lib/keybind.h              |  2 ++
     misc/mc.default.keymap     |  2 ++
     misc/mc.emacs.keymap       |  2 ++
     src/filemanager/midnight.c | 24 ++++++++----------------
     src/keybind-defaults.c     |  2 ++
     6 files changed, 18 insertions(+), 16 deletions(-)
    
    diff --git a/lib/keybind.c b/lib/keybind.c
    index 89fa9a0..3db3a79 100644
    a b static name_keymap_t command_names[] = { 
    205205    {"SplitLess", CK_SplitLess}, 
    206206    {"PutCurrentPath", CK_PutCurrentPath}, 
    207207    {"PutOtherPath", CK_PutOtherPath}, 
     208    {"PutCurrentSelected", CK_PutCurrentSelected}, 
     209    {"PutCurrentFullSelected", CK_PutCurrentFullSelected}, 
    208210    {"PutCurrentTagged", CK_PutCurrentTagged}, 
    209211    {"PutOtherTagged", CK_PutOtherTagged}, 
    210212    {"Select", CK_Select}, 
  • lib/keybind.h

    diff --git a/lib/keybind.h b/lib/keybind.h
    index a88efbc..3484591 100644
    a b enum 
    178178    CK_LinkSymbolicRelative, 
    179179    CK_PutCurrentPath, 
    180180    CK_PutOtherPath, 
     181    CK_PutCurrentSelected, 
     182    CK_PutCurrentFullSelected, 
    181183    CK_PutCurrentTagged, 
    182184    CK_PutOtherTagged, 
    183185    CK_Select, 
  • misc/mc.default.keymap

    diff --git a/misc/mc.default.keymap b/misc/mc.default.keymap
    index 9698bd5..7d61ff8 100644
    a b SplitLess = alt-shift-left 
    3232Shell = ctrl-o 
    3333PutCurrentPath = alt-a 
    3434PutOtherPath = alt-shift-a 
     35PutCurrentSelected = alt-enter; ctrl-enter 
     36PutCurrentFullSelected = ctrl-shift-enter 
    3537ViewFiltered = alt-exclamation 
    3638Select = kpplus 
    3739Unselect = kpminus 
  • misc/mc.emacs.keymap

    diff --git a/misc/mc.emacs.keymap b/misc/mc.emacs.keymap
    index cfce480..8b4842a 100644
    a b SplitLess = alt-shift-left 
    3232Shell = ctrl-o 
    3333PutCurrentPath = alt-a 
    3434PutOtherPath = alt-shift-a 
     35PutCurrentSelected = alt-enter; ctrl-enter 
     36PutCurrentFullSelected = ctrl-shift-enter 
    3537ViewFiltered = alt-exclamation 
    3638Select = kpplus 
    3739Unselect = kpminus 
  • src/filemanager/midnight.c

    diff --git a/src/filemanager/midnight.c b/src/filemanager/midnight.c
    index 2c31952..e312b2c 100644
    a b put_other_link (void) 
    784784 
    785785/** Insert the selected file name into the input line */ 
    786786static void 
    787 put_prog_name (void) 
     787put_current_selected (void) 
    788788{ 
    789789    const char *tmp; 
    790790 
    midnight_execute_cmd (Widget * sender, long command) 
    11471147    case CK_PutCurrentPath: 
    11481148        midnight_put_panel_path (current_panel); 
    11491149        break; 
     1150    case CK_PutCurrentSelected: 
     1151        put_current_selected (); 
     1152        break; 
     1153    case CK_PutCurrentFullSelected: 
     1154        midnight_put_panel_path (current_panel); 
     1155        put_current_selected (); 
     1156        break; 
    11501157    case CK_PutCurrentLink: 
    11511158        put_current_link (); 
    11521159        break; 
    midnight_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void 
    14841491            cmdline->point = 0; 
    14851492        } 
    14861493 
    1487         /* Ctrl-Enter and Alt-Enter */ 
    1488         if (((parm & ~(KEY_M_CTRL | KEY_M_ALT)) == '\n') && (parm & (KEY_M_CTRL | KEY_M_ALT))) 
    1489         { 
    1490             put_prog_name (); 
    1491             return MSG_HANDLED; 
    1492         } 
    1493  
    1494         /* Ctrl-Shift-Enter */ 
    1495         if (parm == (KEY_M_CTRL | KEY_M_SHIFT | '\n')) 
    1496         { 
    1497             midnight_put_panel_path (current_panel); 
    1498             put_prog_name (); 
    1499             return MSG_HANDLED; 
    1500         } 
    1501  
    15021494        if ((!mc_global.tty.alternate_plus_minus 
    15031495             || !(mc_global.tty.console_flag != '\0' || mc_global.tty.xterm_flag)) && !quote 
    15041496            && !current_panel->searching) 
  • src/keybind-defaults.c

    diff --git a/src/keybind-defaults.c b/src/keybind-defaults.c
    index 20a31d3..38b4afb 100644
    a b static const global_keymap_ini_t default_main_keymap[] = { 
    100100    /* Copy useful information to the command line */ 
    101101    {"PutCurrentPath", "alt-a"}, 
    102102    {"PutOtherPath", "alt-shift-a"}, 
     103    {"PutCurrentSelected", "alt-enter; ctrl-enter"}, 
     104    {"PutCurrentFullSelected", "ctrl-shift-enter"}, 
    103105    {"CdQuick", "alt-c"}, 
    104106    /* To access the directory hotlist */ 
    105107    {"HotList", "ctrl-backspace"},