From 72bb0758284c601e1b376c816b06294edf643953 Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Thu, 29 Apr 2010 19:30:06 +0000 Subject: [PATCH 1/6] Ticket #2161 (del - clear input field) new behavior: DEL - clear current field of dialog if text in the field is not modify and cursor not moved. Signed-off-by: Ilia Maslakov Code cleanups: avoid compiler warnings Signed-off-by: Slava Zanko --- lib/skin.h | 94 ++++++++++++++++++------------------ lib/skin/colors.c | 3 ++ src/boxes.c | 28 ++++++++--- src/command.c | 8 ++- src/editor/editcmd_dialogs.c | 11 ++++- src/find.c | 17 +++++-- src/panelize.c | 11 ++++- src/widget.c | 22 ++++++--- src/widget.h | 8 ++- src/wtools.c | 12 ++++- 10 files changed, 139 insertions(+), 75 deletions(-) diff --git a/lib/skin.h b/lib/skin.h index 05212f45e..b402a008d 100644 --- a/lib/skin.h +++ b/lib/skin.h @@ -13,77 +13,77 @@ See color-slang.h (A_*) */ /* cache often used colors*/ -#define DEFAULT_COLOR mc_skin_color__cache[0] -#define NORMAL_COLOR mc_skin_color__cache[1] -#define MARKED_COLOR mc_skin_color__cache[2] -#define SELECTED_COLOR mc_skin_color__cache[3] -#define MARKED_SELECTED_COLOR mc_skin_color__cache[4] -#define REVERSE_COLOR mc_skin_color__cache[5] +#define DEFAULT_COLOR mc_skin_color__cache[0] +#define NORMAL_COLOR mc_skin_color__cache[1] +#define MARKED_COLOR mc_skin_color__cache[2] +#define SELECTED_COLOR mc_skin_color__cache[3] +#define MARKED_SELECTED_COLOR mc_skin_color__cache[4] +#define REVERSE_COLOR mc_skin_color__cache[5] +#define COMMAND_MARK_COLOR mc_skin_color__cache[6] /* Dialog colors */ -#define COLOR_NORMAL mc_skin_color__cache[6] -#define COLOR_FOCUS mc_skin_color__cache[7] -#define COLOR_HOT_NORMAL mc_skin_color__cache[8] -#define COLOR_HOT_FOCUS mc_skin_color__cache[9] +#define COLOR_NORMAL mc_skin_color__cache[7] +#define COLOR_FOCUS mc_skin_color__cache[8] +#define COLOR_HOT_NORMAL mc_skin_color__cache[9] +#define COLOR_HOT_FOCUS mc_skin_color__cache[10] /* Error dialog colors */ -#define ERROR_COLOR mc_skin_color__cache[10] -#define ERROR_HOT_NORMAL mc_skin_color__cache[11] -#define ERROR_HOT_FOCUS mc_skin_color__cache[12] +#define ERROR_COLOR mc_skin_color__cache[11] +#define ERROR_HOT_NORMAL mc_skin_color__cache[12] +#define ERROR_HOT_FOCUS mc_skin_color__cache[13] /* Menu colors */ -#define MENU_ENTRY_COLOR mc_skin_color__cache[13] -#define MENU_SELECTED_COLOR mc_skin_color__cache[14] -#define MENU_HOT_COLOR mc_skin_color__cache[15] -#define MENU_HOTSEL_COLOR mc_skin_color__cache[16] -#define MENU_INACTIVE_COLOR mc_skin_color__cache[17] +#define MENU_ENTRY_COLOR mc_skin_color__cache[14] +#define MENU_SELECTED_COLOR mc_skin_color__cache[15] +#define MENU_HOT_COLOR mc_skin_color__cache[16] +#define MENU_HOTSEL_COLOR mc_skin_color__cache[17] +#define MENU_INACTIVE_COLOR mc_skin_color__cache[18] /* * This should be selectable independently. Default has to be black background * foreground does not matter at all. */ -#define GAUGE_COLOR mc_skin_color__cache[18] -#define INPUT_COLOR mc_skin_color__cache[19] +#define GAUGE_COLOR mc_skin_color__cache[19] +#define INPUT_COLOR mc_skin_color__cache[20] +#define INPUT_INACTIVE_COLOR mc_skin_color__cache[21] +#define INPUT_MARK_COLOR mc_skin_color__cache[22] -#define HELP_NORMAL_COLOR mc_skin_color__cache[20] -#define HELP_ITALIC_COLOR mc_skin_color__cache[21] -#define HELP_BOLD_COLOR mc_skin_color__cache[22] -#define HELP_LINK_COLOR mc_skin_color__cache[23] -#define HELP_SLINK_COLOR mc_skin_color__cache[24] +#define HELP_NORMAL_COLOR mc_skin_color__cache[23] +#define HELP_ITALIC_COLOR mc_skin_color__cache[24] +#define HELP_BOLD_COLOR mc_skin_color__cache[25] +#define HELP_LINK_COLOR mc_skin_color__cache[26] +#define HELP_SLINK_COLOR mc_skin_color__cache[27] -#define VIEW_UNDERLINED_COLOR mc_skin_color__cache[25] +#define VIEW_UNDERLINED_COLOR mc_skin_color__cache[28] /* * editor colors - only 4 for normal, search->found, select, and whitespace * respectively * Last is defined to view color. */ -#define EDITOR_NORMAL_COLOR mc_skin_color__cache[26] -#define EDITOR_BOLD_COLOR mc_skin_color__cache[27] -#define EDITOR_MARKED_COLOR mc_skin_color__cache[28] -#define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[29] -#define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[30] +#define EDITOR_NORMAL_COLOR mc_skin_color__cache[29] +#define EDITOR_BOLD_COLOR mc_skin_color__cache[30] +#define EDITOR_MARKED_COLOR mc_skin_color__cache[31] +#define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[32] +#define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[33] /* color of left 8 char status per line */ -#define LINE_STATE_COLOR mc_skin_color__cache[31] -#define BOOK_MARK_COLOR mc_skin_color__cache[32] -#define BOOK_MARK_FOUND_COLOR mc_skin_color__cache[33] +#define LINE_STATE_COLOR mc_skin_color__cache[34] +#define BOOK_MARK_COLOR mc_skin_color__cache[35] +#define BOOK_MARK_FOUND_COLOR mc_skin_color__cache[36] -#define BUTTONBAR_HOTKEY_COLOR mc_skin_color__cache[34] -#define BUTTONBAR_BUTTON_COLOR mc_skin_color__cache[35] +#define BUTTONBAR_HOTKEY_COLOR mc_skin_color__cache[37] +#define BUTTONBAR_BUTTON_COLOR mc_skin_color__cache[38] /* Diff colors */ -#define DFF_ADD_COLOR mc_skin_color__cache[36] -#define DFF_CHG_COLOR mc_skin_color__cache[37] -#define DFF_CHH_COLOR mc_skin_color__cache[38] -#define DFF_CHD_COLOR mc_skin_color__cache[39] -#define DFF_DEL_COLOR mc_skin_color__cache[40] -#define DFF_FOLDER_COLOR mc_skin_color__cache[41] -#define DFF_ERROR_COLOR mc_skin_color__cache[42] - - - -#define MC_SKIN_COLOR_CACHE_COUNT 43 +#define DFF_ADD_COLOR mc_skin_color__cache[39] +#define DFF_CHG_COLOR mc_skin_color__cache[40] +#define DFF_CHH_COLOR mc_skin_color__cache[41] +#define DFF_CHD_COLOR mc_skin_color__cache[42] +#define DFF_DEL_COLOR mc_skin_color__cache[43] +#define DFF_FOLDER_COLOR mc_skin_color__cache[44] +#define DFF_ERROR_COLOR mc_skin_color__cache[45] +#define MC_SKIN_COLOR_CACHE_COUNT 46 /*** enums ***************************************************************************************/ diff --git a/lib/skin/colors.c b/lib/skin/colors.c index b9df0695f..bfe3f470d 100644 --- a/lib/skin/colors.c +++ b/lib/skin/colors.c @@ -202,6 +202,7 @@ mc_skin_color_cache_init (void) SELECTED_COLOR = mc_skin_color_get ("core", "selected"); MARKED_SELECTED_COLOR = mc_skin_color_get ("core", "markselect"); REVERSE_COLOR = mc_skin_color_get ("core", "reverse"); + COMMAND_MARK_COLOR = mc_skin_color_get ("core", "commandlinemark"); COLOR_NORMAL = mc_skin_color_get ("dialog", "_default_"); COLOR_FOCUS = mc_skin_color_get ("dialog", "dfocus"); @@ -220,6 +221,8 @@ mc_skin_color_cache_init (void) GAUGE_COLOR = mc_skin_color_get ("core", "gauge"); INPUT_COLOR = mc_skin_color_get ("core", "input"); + INPUT_MARK_COLOR = mc_skin_color_get ("core", "inputmark"); + INPUT_INACTIVE_COLOR = mc_skin_color_get ("core", "inputinactive"); HELP_NORMAL_COLOR = mc_skin_color_get ("help", "_default_"); HELP_ITALIC_COLOR = mc_skin_color_get ("help", "helpitalic"); diff --git a/src/boxes.c b/src/boxes.c index c205e7b4f..7058f375a 100644 --- a/src/boxes.c +++ b/src/boxes.c @@ -136,6 +136,13 @@ display_init (int radio_sel, char *init_text, int _check_status, char **_status) int dlg_width = 48, dlg_height = 15; Dlg_head *dd; + const int input_colors[3] = + { + INPUT_COLOR, + INPUT_INACTIVE_COLOR, + INPUT_MARK_COLOR + }; + /* Controls whether the array strings have been translated */ const char *displays[LIST_TYPES] = { N_("&Full file list"), @@ -202,7 +209,7 @@ display_init (int radio_sel, char *init_text, int _check_status, char **_status) add_widget (dd, cancel_button); add_widget (dd, ok_button); - display_mini_status = input_new (10, 8, INPUT_COLOR, dlg_width - 12, _status[radio_sel], + display_mini_status = input_new (10, 8, (int *) input_colors, dlg_width - 12, _status[radio_sel], "mini-input", INPUT_COMPLETE_DEFAULT); add_widget (dd, display_mini_status); input_set_point (display_mini_status, 0); @@ -210,7 +217,7 @@ display_init (int radio_sel, char *init_text, int _check_status, char **_status) display_check_status = check_new (9, 4, _check_status, user_mini_status); add_widget (dd, display_check_status); - display_user_format = input_new (7, 8, INPUT_COLOR, dlg_width - 12, init_text, + display_user_format = input_new (7, 8, (int *) input_colors, dlg_width - 12, init_text, "user-fmt-input", INPUT_COMPLETE_DEFAULT); add_widget (dd, display_user_format); input_set_point (display_user_format, 0); @@ -1015,6 +1022,13 @@ vfs_smb_get_authinfo (const char *host, const char *share, const char *domain, c WInput *in_domain; Dlg_head *auth_dlg; + const int input_colors[3] = + { + INPUT_COLOR, + INPUT_INACTIVE_COLOR, + INPUT_MARK_COLOR + }; + #ifdef ENABLE_NLS static int i18n_flag = 0; @@ -1063,17 +1077,17 @@ vfs_smb_get_authinfo (const char *host, const char *share, const char *domain, c g_free (title); - in_user = input_new (5, istart, INPUT_COLOR, ilen, user, "auth_name", INPUT_COMPLETE_DEFAULT); + in_user = input_new (5, istart, (int *) input_colors, ilen, user, "auth_name", INPUT_COMPLETE_DEFAULT); add_widget (auth_dlg, in_user); - in_domain = - input_new (3, istart, INPUT_COLOR, ilen, domain, "auth_domain", INPUT_COMPLETE_DEFAULT); + in_domain = input_new (3, istart, (int *) input_colors, ilen, domain, "auth_domain", INPUT_COMPLETE_DEFAULT); + add_widget (auth_dlg, in_domain); add_widget (auth_dlg, button_new (9, b2, B_CANCEL, NORMAL_BUTTON, buts[1], 0)); add_widget (auth_dlg, button_new (9, b0, B_ENTER, DEFPUSH_BUTTON, buts[0], 0)); - in_password = - input_new (7, istart, INPUT_COLOR, ilen, "", "auth_password", INPUT_COMPLETE_DEFAULT); + in_password = input_new (7, istart, (int *) input_colors, ilen, "", "auth_password", INPUT_COMPLETE_DEFAULT); + in_password->completion_flags = 0; in_password->is_password = 1; add_widget (auth_dlg, in_password); diff --git a/src/command.c b/src/command.c index e3dd83e78..e9ee41d27 100644 --- a/src/command.c +++ b/src/command.c @@ -305,8 +305,14 @@ WInput * command_new (int y, int x, int cols) { WInput *cmd; + const int command_colors[3] = + { + DEFAULT_COLOR, + DEFAULT_COLOR, + COMMAND_MARK_COLOR + }; - cmd = input_new (y, x, DEFAULT_COLOR, cols, "", "cmdline", + cmd = input_new (y, x, (int *) command_colors, cols, "", "cmdline", INPUT_COMPLETE_DEFAULT | INPUT_COMPLETE_CD | INPUT_COMPLETE_COMMANDS | INPUT_COMPLETE_SHELL_ESC); /* Add our hooks */ diff --git a/src/editor/editcmd_dialogs.c b/src/editor/editcmd_dialogs.c index 5e895cf3e..c1daae066 100644 --- a/src/editor/editcmd_dialogs.c +++ b/src/editor/editcmd_dialogs.c @@ -312,11 +312,18 @@ int editcmd_dialog_raw_key_query (const char *heading, const char *query, int cancel) { int w = str_term_width1 (query) + 7; + const int input_colors[3] = + { + INPUT_COLOR, + INPUT_INACTIVE_COLOR, + INPUT_MARK_COLOR + }; + struct Dlg_head *raw_dlg = create_dlg (0, 0, 7, w, dialog_colors, editcmd_dialog_raw_key_query_cb, NULL, heading, DLG_CENTER | DLG_TRYUP | DLG_WANT_TAB); - add_widget (raw_dlg, - input_new (3 - cancel, w - 5, INPUT_COLOR, 2, "", 0, INPUT_COMPLETE_DEFAULT)); + add_widget (raw_dlg, input_new (3 - cancel, w - 5, (int *) input_colors, + 2, "", 0, INPUT_COMPLETE_DEFAULT)); add_widget (raw_dlg, label_new (3 - cancel, 2, query)); if (cancel) add_widget (raw_dlg, button_new (4, w / 2 - 5, B_CANCEL, NORMAL_BUTTON, _("Cancel"), 0)); diff --git a/src/find.c b/src/find.c index 70eb6e356..58f9a7e99 100644 --- a/src/find.c +++ b/src/find.c @@ -384,6 +384,13 @@ find_parameters (char **start_dir, char **pattern, char **content) const char *buts[] = { N_("&OK"), N_("&Cancel"), N_("&Tree") }; + const int input_colors[3] = + { + INPUT_COLOR, + INPUT_INACTIVE_COLOR, + INPUT_MARK_COLOR + }; + int b0, b1, b2; #ifdef ENABLE_NLS @@ -467,20 +474,20 @@ find_parameters (char **start_dir, char **pattern, char **content) file_case_sens_cbox = check_new (7, 3, options.file_case_sens, file_case_label); add_widget (find_dlg, file_case_sens_cbox); - in_with = input_new (6, FIND_X / 2 + 1, INPUT_COLOR, FIND_X / 2 - 4, INPUT_LAST_TEXT, + in_with = input_new (6, FIND_X / 2 + 1, (int *) input_colors, FIND_X / 2 - 4, INPUT_LAST_TEXT, MC_HISTORY_SHARED_SEARCH, INPUT_COMPLETE_DEFAULT); add_widget (find_dlg, in_with); add_widget (find_dlg, label_new (5, FIND_X / 2 + 1, _("Content:"))); - in_name = input_new (6, 3, INPUT_COLOR, FIND_X / 2 - 4, INPUT_LAST_TEXT, "name", - INPUT_COMPLETE_DEFAULT); + in_name = input_new (6, 3, (int *) input_colors, + FIND_X / 2 - 4, INPUT_LAST_TEXT, "name", INPUT_COMPLETE_DEFAULT); add_widget (find_dlg, in_name); add_widget (find_dlg, label_new (5, 3, _("File name:"))); add_widget (find_dlg, button_new (3, FIND_X - b2 - 2, B_TREE, NORMAL_BUTTON, buts[2], 0)); - in_start = input_new (3, 3, INPUT_COLOR, FIND_X - b2 - 6, in_start_dir, "start", - INPUT_COMPLETE_DEFAULT); + in_start = input_new (3, 3, (int *) input_colors, + FIND_X - b2 - 6, in_start_dir, "start", INPUT_COMPLETE_DEFAULT); add_widget (find_dlg, in_start); add_widget (find_dlg, label_new (2, 3, _("Start at:"))); diff --git a/src/panelize.c b/src/panelize.c index c24bef3ca..b9bf09671 100644 --- a/src/panelize.c +++ b/src/panelize.c @@ -139,6 +139,13 @@ init_panelize (void) static int i18n_flag = 0; static int maxlen = 0; + const int input_colors[3] = + { + INPUT_COLOR, + INPUT_INACTIVE_COLOR, + INPUT_MARK_COLOR + }; + if (!i18n_flag) { i = sizeof (panelize_but) / sizeof (panelize_but[0]); @@ -176,8 +183,8 @@ init_panelize (void) panelize_but[i].flags, panelize_but[i].text, 0)); pname = - input_new (UY + 14, UX, INPUT_COLOR, panelize_dlg->cols - 10, "", - "in", INPUT_COMPLETE_DEFAULT); + input_new (UY + 14, UX, (int *) input_colors, + panelize_dlg->cols - 10, "", "in", INPUT_COMPLETE_DEFAULT); add_widget (panelize_dlg, pname); add_widget (panelize_dlg, label_new (UY + 13, UX, _("Command"))); diff --git a/src/widget.c b/src/widget.c index e0121e52d..b5b562e20 100644 --- a/src/widget.c +++ b/src/widget.c @@ -1079,7 +1079,10 @@ update_input (WInput * in, int clear_first) if (has_history) draw_history_button (in); - tty_setcolor (in->color); + if (in->first) + tty_setcolor (in->inactive_color); + else + tty_setcolor (in->color); widget_move (&in->widget, 0, 0); @@ -1103,7 +1106,7 @@ update_input (WInput * in, int clear_first) } if (clear_first) - in->first = 0; + in->first = FALSE; } void @@ -1920,7 +1923,7 @@ port_region_marked_for_delete (WInput * in) { in->buffer[0] = '\0'; in->point = 0; - in->first = 0; + in->first = FALSE; in->charpoint = 0; } @@ -1965,7 +1968,10 @@ input_execute_cmd (WInput * in, unsigned long command) backward_delete (in); break; case CK_InputDeleteChar: - delete_char (in); + if (in->first) + port_region_marked_for_delete (in); + else + delete_char (in); break; case CK_InputKillWord: kill_word (in); @@ -2179,7 +2185,7 @@ input_event (Gpm_Event * event, void *data) } WInput * -input_new (int y, int x, int color, int width, const char *def_text, +input_new (int y, int x, int *input_colors, int width, const char *def_text, const char *histname, INPUT_COMPLETE_FLAGS completion_flags) { WInput *in = g_new (WInput, 1); @@ -2212,9 +2218,11 @@ input_new (int y, int x, int color, int width, const char *def_text, in->completion_flags = completion_flags; in->current_max_size = initial_buffer_len; in->buffer = g_new (char, initial_buffer_len); - in->color = color; + in->color = input_colors[0]; + in->mark_color = input_colors[2]; + in->inactive_color = input_colors[1]; in->field_width = width; - in->first = 1; + in->first = TRUE; in->term_first_shown = 0; in->disable_update = 0; in->mark = 0; diff --git a/src/widget.h b/src/widget.h index 00c9269b8..489a64db7 100644 --- a/src/widget.h +++ b/src/widget.h @@ -106,7 +106,9 @@ typedef struct { size_t current_max_size; /* Maximum length of input line (bytes) */ int field_width; /* width of the editing field */ int color; /* color used */ - int first; /* Is first keystroke? */ + int mark_color; /* color for marked text */ + int inactive_color; /* color for inactive text (Is first keystroke) */ + gboolean first; /* Is first keystroke? */ int disable_update; /* Do we want to skip updates? */ int is_password; /* Is this a password input line? */ char *buffer; /* pointer to editing buffer */ @@ -192,7 +194,9 @@ WButton *button_new (int y, int x, int action, int flags, const char *text, bcback callback); WRadio *radio_new (int y, int x, int count, const char **text); WCheck *check_new (int y, int x, int state, const char *text); -WInput *input_new (int y, int x, int color, int len, const char *text, const char *histname, INPUT_COMPLETE_FLAGS completion_flags); +WInput *input_new (int y, int x, int *input_colors, + int len, const char *text, const char *histname, + INPUT_COMPLETE_FLAGS completion_flags); WLabel *label_new (int y, int x, const char *text); WHLine *hline_new (int y, int x, int width); diff --git a/src/wtools.c b/src/wtools.c index cbb9a0dc4..7b35af1a9 100644 --- a/src/wtools.c +++ b/src/wtools.c @@ -367,6 +367,13 @@ quick_dialog_skip (QuickDialog *qd, int nskip) WRadio *r; int return_val; + const int input_colors[3] = + { + INPUT_COLOR, + INPUT_INACTIVE_COLOR, + INPUT_MARK_COLOR + }; + I18N (qd->title); if ((qd->xpos == -1) || (qd->ypos == -1)) @@ -397,8 +404,9 @@ quick_dialog_skip (QuickDialog *qd, int nskip) break; case quick_input: - in = input_new (ypos, xpos, INPUT_COLOR, qw->u.input.len, - qw->u.input.text, qw->u.input.histname, INPUT_COMPLETE_DEFAULT); + in = input_new (ypos, xpos, (int *) input_colors, + qw->u.input.len, qw->u.input.text, qw->u.input.histname, + INPUT_COMPLETE_DEFAULT); in->is_password = (qw->u.input.flags == 1); in->point = 0; if ((qw->u.input.flags & 2) != 0) From a4e43788614cc1172c9a7a34b115fc177641a924 Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Sun, 2 May 2010 22:33:08 +0000 Subject: [PATCH 2/6] initial step to do mark in inpun fields added selection with mouse Signed-off-by: Ilia Maslakov Code cleanup: make visibility of some functions as static Signed-off-by: Slava Zanko Signed-off-by: Ilia Maslakov fixed skins Signed-off-by: Ilia Maslakov --- lib/skin.h | 2 +- lib/skin/colors-old.c | 3 + lib/skin/colors.c | 2 +- misc/mc.keymap.default | 6 ++ misc/mc.keymap.emacs | 6 ++ misc/skins/darkfar.ini | 3 + misc/skins/default.ini | 3 + misc/skins/double-lines.ini | 3 + misc/skins/featured.ini | 3 + src/args.c | 3 +- src/boxes.c | 4 +- src/cmddef.h | 7 ++ src/diffviewer/ydiff.c | 1 + src/editor/editcmd_dialogs.c | 2 +- src/find.c | 2 +- src/keybind.c | 6 ++ src/panelize.c | 2 +- src/widget.c | 189 ++++++++++++++++++++++++++++++----- src/widget.h | 3 +- src/wtools.c | 2 +- 20 files changed, 216 insertions(+), 36 deletions(-) diff --git a/lib/skin.h b/lib/skin.h index b402a008d..006881dbe 100644 --- a/lib/skin.h +++ b/lib/skin.h @@ -45,7 +45,7 @@ */ #define GAUGE_COLOR mc_skin_color__cache[19] #define INPUT_COLOR mc_skin_color__cache[20] -#define INPUT_INACTIVE_COLOR mc_skin_color__cache[21] +#define INPUT_UNCHANGED_COLOR mc_skin_color__cache[21] #define INPUT_MARK_COLOR mc_skin_color__cache[22] #define HELP_NORMAL_COLOR mc_skin_color__cache[23] diff --git a/lib/skin/colors-old.c b/lib/skin/colors-old.c index 13a505648..1fd2633d8 100644 --- a/lib/skin/colors-old.c +++ b/lib/skin/colors-old.c @@ -70,6 +70,9 @@ static const mc_skin_colors_old_t old_colors[] = { {"menuinactive", "menu", "menuinactive"}, {"gauge", "core", "gauge"}, {"input", "core", "input"}, + {"inputmark", "core", "inputmark"}, + {"inputunchanged", "core", "inputunchanged"}, + {"commandlinemark", "core", "commandlinemark"}, {"helpnormal", "help", "_default_"}, {"helpitalic", "help", "helpitalic"}, {"helpbold", "help", "helpbold"}, diff --git a/lib/skin/colors.c b/lib/skin/colors.c index bfe3f470d..8bb8fd883 100644 --- a/lib/skin/colors.c +++ b/lib/skin/colors.c @@ -222,7 +222,7 @@ mc_skin_color_cache_init (void) GAUGE_COLOR = mc_skin_color_get ("core", "gauge"); INPUT_COLOR = mc_skin_color_get ("core", "input"); INPUT_MARK_COLOR = mc_skin_color_get ("core", "inputmark"); - INPUT_INACTIVE_COLOR = mc_skin_color_get ("core", "inputinactive"); + INPUT_UNCHANGED_COLOR = mc_skin_color_get ("core", "inputunchanged"); HELP_NORMAL_COLOR = mc_skin_color_get ("help", "_default_"); HELP_ITALIC_COLOR = mc_skin_color_get ("help", "helpitalic"); diff --git a/misc/mc.keymap.default b/misc/mc.keymap.default index 3d5574fe9..eb4f2e541 100644 --- a/misc/mc.keymap.default +++ b/misc/mc.keymap.default @@ -330,6 +330,12 @@ InputHistoryNext = alt-n; ctrl-up InputHistoryShow = alt-h InputComplete = alt-tab InputClearLine = +InputLeftHighlight = +InputRightHighlight = +InputWordLeftHighlight = +InputWordRightHighlight = +InputBolHighlight = +InputEolHighlight = [tree] TreeHelp = f1 diff --git a/misc/mc.keymap.emacs b/misc/mc.keymap.emacs index 535299d9b..985f65319 100644 --- a/misc/mc.keymap.emacs +++ b/misc/mc.keymap.emacs @@ -334,6 +334,12 @@ InputHistoryNext = alt-n; ctrl-up InputHistoryShow = alt-h InputComplete = alt-tab InputClearLine = +InputLeftHighlight = +InputRightHighlight = +InputWordLeftHighlight = +InputWordRightHighlight = +InputBolHighlight = +InputEolHighlight = [tree] TreeHelp = f1 diff --git a/misc/skins/darkfar.ini b/misc/skins/darkfar.ini index 60f460a78..9a7c1a76a 100644 --- a/misc/skins/darkfar.ini +++ b/misc/skins/darkfar.ini @@ -31,7 +31,10 @@ markselect=yellow;cyan gauge=white;black input=black;cyan + inputunchanged=gray;cyan + inputmark=cyan;black reverse=black;lightgray + commandlinemark=black;lightgray [dialog] _default_=brightcyan;blue diff --git a/misc/skins/default.ini b/misc/skins/default.ini index 608672855..44a723d1a 100644 --- a/misc/skins/default.ini +++ b/misc/skins/default.ini @@ -31,7 +31,10 @@ markselect=yellow;cyan gauge=white;black input=black;cyan + inputunchanged=gray;cyan + inputmark=cyan;black reverse=black;lightgray + commandlinemark=black;lightgray [dialog] _default_=black;lightgray diff --git a/misc/skins/double-lines.ini b/misc/skins/double-lines.ini index 5f837a268..5266d8a54 100644 --- a/misc/skins/double-lines.ini +++ b/misc/skins/double-lines.ini @@ -32,6 +32,9 @@ gauge=white;black input=black;cyan reverse=black;lightgray + inputunchanged=gray;cyan + inputmark=cyan;black + commandlinemark=black;lightgray [dialog] _default_=black;lightgray diff --git a/misc/skins/featured.ini b/misc/skins/featured.ini index 7cfc8a85d..0dcaa24f6 100644 --- a/misc/skins/featured.ini +++ b/misc/skins/featured.ini @@ -33,7 +33,10 @@ markselect=yellow;cyan gauge=white;black input=black;cyan + inputunchanged=gray;cyan + inputmark=cyan;black reverse=black;lightgray + commandlinemark=black;lightgray [dialog] _default_=black;lightgray diff --git a/src/args.c b/src/args.c index 9da8eb525..d09556628 100644 --- a/src/args.c +++ b/src/args.c @@ -326,7 +326,8 @@ mc_args_new_color_group (void) _("--colors KEYWORD={FORE},{BACK}\n\n" "{FORE} and {BACK} can be omitted, and the default will be used\n" "\n" "Keywords:\n" - " Global: errors, reverse, gauge, input, viewunderline\n" + " Global: errors, reverse, gauge, viewunderline\n" + " input, inputmark, inputunchanged, commandlinemark\n" " File display: normal, selected, marked, markselect\n" " Dialog boxes: dnormal, dfocus, dhotnormal, dhotfocus, errdhotnormal,\n" " errdhotfocus\n" diff --git a/src/boxes.c b/src/boxes.c index 7058f375a..af04661e6 100644 --- a/src/boxes.c +++ b/src/boxes.c @@ -139,7 +139,7 @@ display_init (int radio_sel, char *init_text, int _check_status, char **_status) const int input_colors[3] = { INPUT_COLOR, - INPUT_INACTIVE_COLOR, + INPUT_UNCHANGED_COLOR, INPUT_MARK_COLOR }; @@ -1025,7 +1025,7 @@ vfs_smb_get_authinfo (const char *host, const char *share, const char *domain, c const int input_colors[3] = { INPUT_COLOR, - INPUT_INACTIVE_COLOR, + INPUT_UNCHANGED_COLOR, INPUT_MARK_COLOR }; diff --git a/src/cmddef.h b/src/cmddef.h index dfd61f1f5..4e74fbb98 100644 --- a/src/cmddef.h +++ b/src/cmddef.h @@ -255,6 +255,13 @@ #define CK_InputPaste 4025 #define CK_InputClearLine 4026 +#define CK_InputLeftHighlight 4027 +#define CK_InputRightHighlight 4028 +#define CK_InputWordLeftHighlight 4029 +#define CK_InputWordRightHighlight 4030 +#define CK_InputBolHighlight 4031 +#define CK_InputEolHighlight 4032 + /* Viewer */ #define CK_ViewHelp 5001 #define CK_ViewToggleWrapMode 5002 diff --git a/src/diffviewer/ydiff.c b/src/diffviewer/ydiff.c index a04b27660..b44eee0bd 100644 --- a/src/diffviewer/ydiff.c +++ b/src/diffviewer/ydiff.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "lib/global.h" #include "lib/tty/tty.h" diff --git a/src/editor/editcmd_dialogs.c b/src/editor/editcmd_dialogs.c index c1daae066..7d8843d21 100644 --- a/src/editor/editcmd_dialogs.c +++ b/src/editor/editcmd_dialogs.c @@ -315,7 +315,7 @@ editcmd_dialog_raw_key_query (const char *heading, const char *query, int cancel const int input_colors[3] = { INPUT_COLOR, - INPUT_INACTIVE_COLOR, + INPUT_UNCHANGED_COLOR, INPUT_MARK_COLOR }; diff --git a/src/find.c b/src/find.c index 58f9a7e99..1eb65bb60 100644 --- a/src/find.c +++ b/src/find.c @@ -387,7 +387,7 @@ find_parameters (char **start_dir, char **pattern, char **content) const int input_colors[3] = { INPUT_COLOR, - INPUT_INACTIVE_COLOR, + INPUT_UNCHANGED_COLOR, INPUT_MARK_COLOR }; diff --git a/src/keybind.c b/src/keybind.c index fbc118cf2..1479d8594 100644 --- a/src/keybind.c +++ b/src/keybind.c @@ -477,6 +477,12 @@ static name_keymap_t command_names[] = { { "InputXStore", CK_InputKillSave }, { "InputXPaste", CK_InputPaste }, { "InputClearLine", CK_InputClearLine }, + { "InputLeftHighlight", CK_InputLeftHighlight }, + { "InputRightHighlight", CK_InputRightHighlight}, + { "InputWordLeftHighlight", CK_InputWordLeftHighlight}, + { "InputWordRightHighlight", CK_InputWordRightHighlight}, + { "InputBolHighlight", CK_InputBolHighlight}, + { "InputEolHighlight", CK_InputEolHighlight}, /* common */ { "ExtMap1", CK_StartExtMap1 }, diff --git a/src/panelize.c b/src/panelize.c index b9bf09671..fce107115 100644 --- a/src/panelize.c +++ b/src/panelize.c @@ -142,7 +142,7 @@ init_panelize (void) const int input_colors[3] = { INPUT_COLOR, - INPUT_INACTIVE_COLOR, + INPUT_UNCHANGED_COLOR, INPUT_MARK_COLOR }; diff --git a/src/widget.c b/src/widget.c index b5b562e20..a7f8054b8 100644 --- a/src/widget.c +++ b/src/widget.c @@ -1046,6 +1046,60 @@ draw_history_button (WInput * in) /* Pointer to killed data */ static char *kill_buffer = NULL; +static void +input_set_markers (WInput * in, long m1) +{ + in->mark = m1; +} + +static void +input_mark_cmd (WInput * in, gboolean mark) +{ + if (!mark) + { + in->highlight = FALSE; + input_set_markers (in, 0); + } + else + { + in->highlight = TRUE; + input_set_markers (in, in->point); + } +} + +static gboolean +input_eval_marks (WInput * in, long *start_mark, long *end_mark) +{ + if (in->highlight) + { + *start_mark = min (in->mark, in->point); + *end_mark = max (in->mark, in->point); + return TRUE; + } + else + { + *start_mark = *end_mark = 0; + return FALSE; + } +} + +static void +delete_region (WInput * in, int x_first, int x_last) +{ + int first = min (x_first, x_last); + int last = max (x_first, x_last); + size_t len; + + input_mark_cmd (in, FALSE); + in->point = first; + last = str_offset_to_pos (in->buffer, last); + first = str_offset_to_pos (in->buffer, first); + len = strlen (&in->buffer[last]) + 1; + memmove (&in->buffer[first], &in->buffer[last], len); + in->charpoint = 0; + in->need_push = 1; +} + void update_input (WInput * in, int clear_first) { @@ -1080,7 +1134,7 @@ update_input (WInput * in, int clear_first) draw_history_button (in); if (in->first) - tty_setcolor (in->inactive_color); + tty_setcolor (in->unchanged_color); else tty_setcolor (in->color); @@ -1088,16 +1142,43 @@ update_input (WInput * in, int clear_first) if (!in->is_password) { - tty_print_string (str_term_substring (in->buffer, in->term_first_shown, - in->field_width - has_history)); + if (!in->highlight) + { + tty_print_string (str_term_substring (in->buffer, in->term_first_shown, + in->field_width - has_history)); + } + else + { + long m1, m2; + if (input_eval_marks (in, &m1, &m2)) + { + tty_setcolor (in->color); + cp = str_term_substring (in->buffer, in->term_first_shown, in->field_width - has_history); + tty_print_string (cp); + tty_setcolor (in->mark_color); + if (m1 < in->term_first_shown) + { + widget_move (&in->widget, 0, 0); + tty_print_string (str_term_substring (in->buffer, in->term_first_shown, m2 - in->term_first_shown)); + } + else + { + int sel_width; + widget_move (&in->widget, 0, m1 - in->term_first_shown); + sel_width = min (m2 - m1, (in->field_width - has_history) - (str_term_width2 (in->buffer, m1) - in->term_first_shown)); + tty_print_string (str_term_substring (in->buffer, m1, sel_width)); + } + } + } } else { - cp = in->buffer; - for (i = -in->term_first_shown; i < in->field_width - has_history; i++) + cp = str_term_substring (in->buffer, in->term_first_shown, in->field_width - has_history); + for (i = 0; i < in->field_width - has_history; i++) { if (i >= 0) { + tty_setcolor (in->color); tty_print_char ((cp[0] != '\0') ? '*' : ' '); } if (cp[0] != '\0') @@ -1515,6 +1596,7 @@ new_input (WInput * in) in->point = 0; in->charpoint = 0; in->mark = 0; + in->highlight = FALSE; free_completions (in); update_input (in, 0); } @@ -1540,6 +1622,12 @@ insert_char (WInput * in, int c_code) size_t i; int res; + if (in->highlight) + { + long m1, m2; + if (input_eval_marks (in, &m1, &m2)) + delete_region (in, m1, m2); + } if (c_code == -1) return MSG_NOT_HANDLED; @@ -1746,24 +1834,6 @@ copy_region (WInput * in, int x_first, int x_last) save_text_to_clip_file (kill_buffer); } -static void -delete_region (WInput * in, int x_first, int x_last) -{ - int first = min (x_first, x_last); - int last = max (x_first, x_last); - size_t len; - - in->point = first; - if (in->mark > first) - in->mark = first; - last = str_offset_to_pos (in->buffer, last); - first = str_offset_to_pos (in->buffer, first); - len = strlen (&in->buffer[last]) + 1; - memmove (&in->buffer[first], &in->buffer[last], len); - in->charpoint = 0; - in->need_push = 1; -} - static void kill_word (WInput * in) { @@ -1799,7 +1869,7 @@ back_kill_word (WInput * in) static void set_mark (WInput * in) { - in->mark = in->point; + input_mark_cmd (in, TRUE); } static void @@ -1932,24 +2002,55 @@ input_execute_cmd (WInput * in, unsigned long command) { cb_ret_t res = MSG_HANDLED; + /* a highlight command like shift-arrow */ + if (command == CK_InputLeftHighlight || + command == CK_InputRightHighlight || + command == CK_InputWordLeftHighlight || + command == CK_InputWordRightHighlight || + command == CK_InputBolHighlight || + command == CK_InputEolHighlight) + { + if (!in->highlight) + { + input_mark_cmd (in, FALSE); /* clear */ + input_mark_cmd (in, TRUE); /* marking on */ + } + } + + switch (command) + { + case CK_InputForwardWord: + case CK_InputBackwardWord: + case CK_InputForwardChar: + case CK_InputBackwardChar: + if (in->highlight) + input_mark_cmd (in, FALSE); + } + switch (command) { case CK_InputBol: + case CK_InputBolHighlight: beginning_of_line (in); break; case CK_InputEol: + case CK_InputEolHighlight: end_of_line (in); break; case CK_InputMoveLeft: + case CK_InputLeftHighlight: key_left (in); break; case CK_InputWordLeft: + case CK_InputWordLeftHighlight: key_ctrl_left (in); break; case CK_InputMoveRight: + case CK_InputRightHighlight: key_right (in); break; case CK_InputWordRight: + case CK_InputWordRightHighlight: key_ctrl_right (in); break; case CK_InputBackwardChar: @@ -1965,11 +2066,26 @@ input_execute_cmd (WInput * in, unsigned long command) forward_word (in); break; case CK_InputBackwardDelete: - backward_delete (in); + if (in->highlight) + { + long m1, m2; + if (input_eval_marks (in, &m1, &m2)) + delete_region (in, m1, m2); + } + else + { + backward_delete (in); + } break; case CK_InputDeleteChar: if (in->first) port_region_marked_for_delete (in); + else if (in->highlight) + { + long m1, m2; + if (input_eval_marks (in, &m1, &m2)) + delete_region (in, m1, m2); + } else delete_char (in); break; @@ -2016,6 +2132,16 @@ input_execute_cmd (WInput * in, unsigned long command) res = MSG_NOT_HANDLED; } + if (command != CK_InputLeftHighlight && + command != CK_InputRightHighlight && + command != CK_InputWordLeftHighlight && + command != CK_InputWordRightHighlight && + command != CK_InputBolHighlight && + command != CK_InputEolHighlight) + { + in->highlight = FALSE; + } + return res; } @@ -2164,6 +2290,9 @@ input_event (Gpm_Event * event, void *data) { WInput *in = data; + if (event->type & GPM_DOWN) + input_mark_cmd (in, FALSE); + if (event->type & (GPM_DOWN | GPM_DRAG)) { dlg_select_widget (in); @@ -2181,6 +2310,13 @@ input_event (Gpm_Event * event, void *data) } update_input (in, 1); } + /* A lone up mustn't do anything */ + if (in->highlight && event->type & (GPM_UP | GPM_DRAG)) + return MOU_NORMAL; + + if (!(event->type & GPM_DRAG)) + input_mark_cmd (in, TRUE); + return MOU_NORMAL; } @@ -2219,10 +2355,11 @@ input_new (int y, int x, int *input_colors, int width, const char *def_text, in->current_max_size = initial_buffer_len; in->buffer = g_new (char, initial_buffer_len); in->color = input_colors[0]; + in->unchanged_color = input_colors[1]; in->mark_color = input_colors[2]; - in->inactive_color = input_colors[1]; in->field_width = width; in->first = TRUE; + in->highlight = FALSE; in->term_first_shown = 0; in->disable_update = 0; in->mark = 0; diff --git a/src/widget.h b/src/widget.h index 489a64db7..0bdfd384e 100644 --- a/src/widget.h +++ b/src/widget.h @@ -102,12 +102,13 @@ typedef struct { Widget widget; int point; /* cursor position in the input line in characters */ int mark; /* The mark position in characters */ + gboolean highlight; /* There is a selected block */ int term_first_shown; /* column of the first shown character */ size_t current_max_size; /* Maximum length of input line (bytes) */ int field_width; /* width of the editing field */ int color; /* color used */ int mark_color; /* color for marked text */ - int inactive_color; /* color for inactive text (Is first keystroke) */ + int unchanged_color; /* color for inactive text (Is first keystroke) */ gboolean first; /* Is first keystroke? */ int disable_update; /* Do we want to skip updates? */ int is_password; /* Is this a password input line? */ diff --git a/src/wtools.c b/src/wtools.c index 7b35af1a9..8fdc841e3 100644 --- a/src/wtools.c +++ b/src/wtools.c @@ -370,7 +370,7 @@ quick_dialog_skip (QuickDialog *qd, int nskip) const int input_colors[3] = { INPUT_COLOR, - INPUT_INACTIVE_COLOR, + INPUT_UNCHANGED_COLOR, INPUT_MARK_COLOR }; From 9f595d0097bc9271858a8d4bbcde5697fba8629a Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Sat, 8 May 2010 19:25:07 +0000 Subject: [PATCH 3/6] clear 'first' flag by mouse click. Signed-off-by: Ilia Maslakov --- src/widget.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widget.c b/src/widget.c index a7f8054b8..23de4f25c 100644 --- a/src/widget.c +++ b/src/widget.c @@ -2291,8 +2291,10 @@ input_event (Gpm_Event * event, void *data) WInput *in = data; if (event->type & GPM_DOWN) + { + in->first = FALSE; input_mark_cmd (in, FALSE); - + } if (event->type & (GPM_DOWN | GPM_DRAG)) { dlg_select_widget (in); From 3fa80a6828551296a17e2a9dee82637a704d93e1 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Tue, 11 May 2010 12:01:28 +0400 Subject: [PATCH 4/6] quick_input: don't force set cursor position to 0. Signed-off-by: Andrew Borodin --- src/wtools.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/wtools.c b/src/wtools.c index 8fdc841e3..6670fbce7 100644 --- a/src/wtools.c +++ b/src/wtools.c @@ -408,7 +408,6 @@ quick_dialog_skip (QuickDialog *qd, int nskip) qw->u.input.len, qw->u.input.text, qw->u.input.histname, INPUT_COMPLETE_DEFAULT); in->is_password = (qw->u.input.flags == 1); - in->point = 0; if ((qw->u.input.flags & 2) != 0) in->completion_flags |= INPUT_COMPLETE_CD; qw->widget = (Widget *) in; From 7f109a6e5656c9cc3b98cf039e97355c43084eda Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Thu, 27 May 2010 13:20:03 +0300 Subject: [PATCH 5/6] set default keys for Input* actions Signed-off-by: Ilia Maslakov --- misc/mc.keymap.default | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/misc/mc.keymap.default b/misc/mc.keymap.default index eb4f2e541..774b9444f 100644 --- a/misc/mc.keymap.default +++ b/misc/mc.keymap.default @@ -330,12 +330,12 @@ InputHistoryNext = alt-n; ctrl-up InputHistoryShow = alt-h InputComplete = alt-tab InputClearLine = -InputLeftHighlight = -InputRightHighlight = -InputWordLeftHighlight = -InputWordRightHighlight = -InputBolHighlight = -InputEolHighlight = +InputLeftHighlight = shift-left +InputRightHighlight = shift-right +InputWordLeftHighlight = ctrl-shift-left +InputWordRightHighlight = ctrl-shift-right +InputBolHighlight = shift-home +InputEolHighlight = shift-end [tree] TreeHelp = f1 From d3469a33f597978a2bde1a289b9717b6f56cc27b Mon Sep 17 00:00:00 2001 From: Ilia Maslakov Date: Fri, 7 May 2010 16:25:24 +0400 Subject: [PATCH 6/6] fixed man and help Signed-off-by: Ilia Maslakov Signed-off-by: Andrew Borodin --- doc/man/mc.1.in | 14 ++++++++++++-- doc/man/ru/mc.1.in | 25 +++++++++++++++++-------- src/args.c | 1 - 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/doc/man/mc.1.in b/doc/man/mc.1.in index d02d16c4d..7a31f0635 100644 --- a/doc/man/mc.1.in +++ b/doc/man/mc.1.in @@ -3439,7 +3439,8 @@ The format for the color definition is: .fi .PP The colors are optional, and the keywords are: normal, selected, marked, -markselect, errors, input, reverse, gauge. Menu colors are: menunormal, +markselect, errors, input, inputmark, inputunchanged, commandlinemark, +reverse, gauge. Menu colors are: menunormal, menusel, menuhot, menuhotsel, menuinactive. Dialog colors are: dnormal, dfocus, dhotnormal, dhotfocus. Help colors are: helpnormal, helpitalic, helpbold, helplink, helpslink. Viewer color is: viewunderline. Editor @@ -3601,7 +3602,16 @@ cursor on selected data color of the filled part of the progress bar .TP .I input -color of input lines used in query dialogs. +color of input lines used in query dialogs +.TP +.I inputmark +color of input selected text +.TP +.I inputunhanged +color of input text before first modification or cursor movement +.TP +.I commandlinemark +color of selected text in command line .TP .I reverse reverse color diff --git a/doc/man/ru/mc.1.in b/doc/man/ru/mc.1.in index 22886f62e..34bdf2431 100644 --- a/doc/man/ru/mc.1.in +++ b/doc/man/ru/mc.1.in @@ -3713,20 +3713,29 @@ xterm=menu=magenta:marked=,magenta:markselect=,red .PP Цвета не являются обязательными, а в качестве ключевых слов (keywords) могут использоваться: для задания цветовой палитры в панелях: normal, -selected, marked, markselect, errors, input, reverse, gauge; Цвета -пунктов меню: menunormal, menusel, menuhot, menuhotsel, menuinactive; Цвета -в окне диалога: dnormal, dfocus, dhotnormal, dhotfocus; Цвета в окне подсказки: -helpnormal, helpitalic, helpbold, helplink, helpslink; в окне программы -просмотра: viewunderline; специальные подсветки: executable, directory, -link, device, special, core; в окне редактора: editnormal, editbold, -editmarked. +selected, marked, markselect, errors, input, inputmark, inputunchanged, +commandlinemark, reverse, gauge. Цвета пунктов меню: menunormal, menusel, +menuhot, menuhotsel, menuinactive. Цвета в окне диалога: dnormal, dfocus, +dhotnormal, dhotfocus. Цвета в окне подсказки: helpnormal, helpitalic, +helpbold, helplink, helpslink. Цвета в окне программы просмотра: +viewunderline. Специальные подсветки: executable, directory, link, device, +special, core. Цвета в редакторе: editnormal, editbold, editmarked. .PP Цвета задавать не обязательно. Цвет какого именно поля определяется каждым ключевым словом, можно понять из перевода этого ключевого слова. Некоторые случаи требуют пояснений. .PP .I input -определяет цвета в строке ввода в диалоговых окнах. +определяет цвета в строке ввода в диалоговых окнах; +.PP +.I inputmark +цвет выделенного текста в строке ввода в диалоговых окнах; +.PP +.I inputunchanged +цвет текста в строке ввода до первого изменения или до перемещения курсора; +.PP +.I commandlinemark +цвет выделенного текста в командной строке; .PP .I gauge определяет цвет заполненной части полоски (progress bar), при diff --git a/src/args.c b/src/args.c index d09556628..d4742760a 100644 --- a/src/args.c +++ b/src/args.c @@ -320,7 +320,6 @@ mc_args_new_color_group (void) * FIXME: undocumented keywords: viewunderline, editnormal, editbold, * and editmarked. To preserve translations, lines should be split. */ - mc_args__loc__colors_string = g_strdup_printf ("%s%s", /* TRANSLATORS: don't translate keywords and names of colors */ _("--colors KEYWORD={FORE},{BACK}\n\n"