Ticket #204: 0001-Signed-off-by-Mikhail-S.-Pobolovets-styx.mp-gmail.patch

File 0001-Signed-off-by-Mikhail-S.-Pobolovets-styx.mp-gmail.patch, 2.3 KB (added by slavazanko, 16 years ago)
  • src/cmd.c

    From f215b4035f6cc6d07529b3a15f712cdb381fab98 Mon Sep 17 00:00:00 2001
    From: Mikhail S. Pobolovets <styx.mp@gmail.com>
    Date: Wed, 21 Jan 2009 16:28:11 +0200
    Subject: [PATCH] Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
    
    Automatic new directory(Mkdir, F7) name filling.
    Can be configured (on|off) in 'Configure options'.
    ---
     src/cmd.c    |   11 ++++++++++-
     src/option.c |    1 +
     src/setup.c  |    1 +
     3 files changed, 12 insertions(+), 1 deletions(-)
    
    diff --git a/src/cmd.c b/src/cmd.c
    index fca2816..67eadd0 100644
    a b int output_starts_shell = 0; 
    7676/* If set, use the builtin editor */ 
    7777int use_internal_edit = 1; 
    7878 
     79/* Automatically fills name with current selected item name on mkdir */ 
     80int auto_fill_mkdir_name = 1; 
    7981 
    8082int 
    8183view_file_at_line (const char *filename, int plain_view, int internal, 
    void 
    347349mkdir_cmd (void) 
    348350{ 
    349351    char *dir, *absdir; 
     352    char *name = ""; 
     353 
     354    /* If 'on' then automatically fills name with current selected item name */ 
     355    if (auto_fill_mkdir_name) 
     356        name = selection (current_panel)->fname; 
    350357 
    351358    dir = 
    352359        input_expand_dialog (_("Create a new Directory"), 
    353                              _(" Enter directory name:"), ""); 
     360                             _(" Enter directory name:"), 
     361                             name); 
     362 
    354363    if (!dir) 
    355364        return; 
    356365 
  • src/option.c

    diff --git a/src/option.c b/src/option.c
    index 2898266..b02ffda 100644
    a b static struct { 
    6565   {N_("shell &Patterns"),    &easy_patterns,     TOGGLE_VARIABLE,       0 }, 
    6666   {N_("Compute &Totals"),    &file_op_compute_totals, TOGGLE_VARIABLE,  0 }, 
    6767   {N_("&Verbose operation"), &verbose,           TOGGLE_VARIABLE,       0 }, 
     68   {N_("Mkdir autoname"),     &auto_fill_mkdir_name, TOGGLE_VARIABLE,    0 }, 
    6869   /* panel options */ 
    6970   {N_("&Fast dir reload"),   &fast_reload,       toggle_fast_reload,    0 }, 
    7071   {N_("mi&X all files"),     &mix_all_files,     toggle_mix_all_files,  0 }, 
  • src/setup.c

    diff --git a/src/setup.c b/src/setup.c
    index f26566a..865fa4c 100644
    a b static const struct { 
    223223    { "nice_rotating_dash", &nice_rotating_dash }, 
    224224    { "horizontal_split",   &horizontal_split }, 
    225225    { "mcview_remember_file_position", &mcview_remember_file_position }, 
     226    { "auto_fill_mkdir_name", &auto_fill_mkdir_name }, 
    226227    { 0, 0 } 
    227228}; 
    228229