mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 21:06:52 +03:00
Merge branch '2021_MarkFileDown_MarkFileUp'
* 2021_MarkFileDown_MarkFileUp: Ticket #2021 (MarkFileDown/MarkFileUp)
This commit is contained in:
commit
017dbda2d7
@ -260,6 +260,8 @@ CmdDiffView = ctrl-y
|
||||
[panel]
|
||||
PanelStartSearch = ctrl-s; alt-s
|
||||
PanelMarkFile = insert; ctrl-t
|
||||
PanelMarkFileUp = shift-up
|
||||
PanelMarkFileDown = shift-down
|
||||
PanelMoveDown = down; ctrl-n
|
||||
PanelMoveUp = up; ctrl-p
|
||||
PanelMoveLeft = left
|
||||
|
@ -264,6 +264,8 @@ CmdDiffView = ctrl-y
|
||||
[panel]
|
||||
PanelStartSearch = ctrl-s; alt-s
|
||||
PanelMarkFile = insert; ctrl-t
|
||||
PanelMarkFileUp = shift-up
|
||||
PanelMarkFileDown = shift-down
|
||||
PanelMoveDown = down; ctrl-n
|
||||
PanelMoveUp = up; ctrl-p
|
||||
PanelMoveLeft = left
|
||||
|
40
src/cmddef.h
40
src/cmddef.h
@ -399,25 +399,27 @@
|
||||
#define CK_PanelGotoMiddleFile 8018
|
||||
#define CK_PanelGotoTopFile 8019
|
||||
#define CK_PanelMarkFile 8020
|
||||
#define CK_PanelMoveDown 8021
|
||||
#define CK_PanelMoveEnd 8022
|
||||
#define CK_PanelMoveHome 8023
|
||||
#define CK_PanelMoveUp 8024
|
||||
#define CK_PanelMoveLeft 8025
|
||||
#define CK_PanelMoveRight 8026
|
||||
#define CK_PanelNextPage 8027
|
||||
#define CK_PanelPrevPage 8028
|
||||
#define CK_PanelSetPanelEncoding 8029
|
||||
#define CK_PanelStartSearch 8030
|
||||
#define CK_PanelSyncOtherPanel 8031
|
||||
#define CK_PanelToggleSortOrderNext 8032
|
||||
#define CK_PanelToggleSortOrderPrev 8033
|
||||
#define CK_PanelSelectSortOrder 8034
|
||||
#define CK_PanelReverseSort 8035
|
||||
#define CK_PanelSortOrderByName 8036
|
||||
#define CK_PanelSortOrderByExt 8037
|
||||
#define CK_PanelSortOrderBySize 8038
|
||||
#define CK_PanelSortOrderByMTime 8039
|
||||
#define CK_PanelMarkFileUp 8021
|
||||
#define CK_PanelMarkFileDown 8022
|
||||
#define CK_PanelMoveDown 8023
|
||||
#define CK_PanelMoveEnd 8024
|
||||
#define CK_PanelMoveHome 8025
|
||||
#define CK_PanelMoveUp 8026
|
||||
#define CK_PanelMoveLeft 8027
|
||||
#define CK_PanelMoveRight 8028
|
||||
#define CK_PanelNextPage 8029
|
||||
#define CK_PanelPrevPage 8030
|
||||
#define CK_PanelSetPanelEncoding 8031
|
||||
#define CK_PanelStartSearch 8032
|
||||
#define CK_PanelSyncOtherPanel 8033
|
||||
#define CK_PanelToggleSortOrderNext 8034
|
||||
#define CK_PanelToggleSortOrderPrev 8035
|
||||
#define CK_PanelSelectSortOrder 8036
|
||||
#define CK_PanelReverseSort 8037
|
||||
#define CK_PanelSortOrderByName 8038
|
||||
#define CK_PanelSortOrderByExt 8039
|
||||
#define CK_PanelSortOrderBySize 8040
|
||||
#define CK_PanelSortOrderByMTime 8041
|
||||
|
||||
/* diff viewer */
|
||||
#define CK_DiffDisplaySymbols 9001
|
||||
|
@ -424,6 +424,8 @@ static name_keymap_t command_names[] = {
|
||||
{ "PanelGotoMiddleFile", CK_PanelGotoMiddleFile },
|
||||
{ "PanelGotoTopFile", CK_PanelGotoTopFile },
|
||||
{ "PanelMarkFile", CK_PanelMarkFile },
|
||||
{ "PanelMarkFileDown", CK_PanelMarkFileDown },
|
||||
{ "PanelMarkFileUp", CK_PanelMarkFileUp },
|
||||
{ "PanelMoveUp", CK_PanelMoveUp },
|
||||
{ "PanelMoveDown", CK_PanelMoveDown },
|
||||
{ "PanelMoveLeft", CK_PanelMoveLeft },
|
||||
|
40
src/screen.c
40
src/screen.c
@ -73,6 +73,14 @@
|
||||
#define MARKED_SELECTED 3
|
||||
#define STATUS 5
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MARK_DONT_MOVE = 0,
|
||||
MARK_DOWN = 1,
|
||||
MARK_FORCE_DOWN = 2,
|
||||
MARK_FORCE_UP = 3
|
||||
} mark_act_t;
|
||||
|
||||
/*
|
||||
* This describes a format item. The parse_display_format routine parses
|
||||
* the user specified format and creates a linked list of format_e structures.
|
||||
@ -2346,17 +2354,31 @@ do_file_mark (WPanel * panel, int idx, int mark)
|
||||
}
|
||||
|
||||
static void
|
||||
do_mark_file (WPanel * panel, int do_move)
|
||||
do_mark_file (WPanel * panel, mark_act_t do_move)
|
||||
{
|
||||
do_file_mark (panel, panel->selected, selection (panel)->f.marked ? 0 : 1);
|
||||
if (mark_moves_down && do_move)
|
||||
if ((mark_moves_down && do_move == MARK_DOWN) || do_move == MARK_FORCE_DOWN)
|
||||
move_down (panel);
|
||||
else if (do_move == MARK_FORCE_UP)
|
||||
move_up (panel);
|
||||
}
|
||||
|
||||
static void
|
||||
mark_file (WPanel * panel)
|
||||
{
|
||||
do_mark_file (panel, 1);
|
||||
do_mark_file (panel, MARK_DOWN);
|
||||
}
|
||||
|
||||
static void
|
||||
mark_file_up (WPanel * panel)
|
||||
{
|
||||
do_mark_file (panel, MARK_FORCE_UP);
|
||||
}
|
||||
|
||||
static void
|
||||
mark_file_down (WPanel * panel)
|
||||
{
|
||||
do_mark_file (panel, MARK_FORCE_DOWN);
|
||||
}
|
||||
|
||||
/* Incremental search of a file name in the panel */
|
||||
@ -2936,6 +2958,12 @@ panel_execute_cmd (WPanel * panel, unsigned long command)
|
||||
case CK_PanelMarkFile:
|
||||
mark_file (panel);
|
||||
break;
|
||||
case CK_PanelMarkFileUp:
|
||||
mark_file_up (panel);
|
||||
break;
|
||||
case CK_PanelMarkFileDown:
|
||||
mark_file_down (panel);
|
||||
break;
|
||||
case CK_PanelMoveUp:
|
||||
move_up (panel);
|
||||
break;
|
||||
@ -3131,7 +3159,7 @@ static int mouse_marking = 0;
|
||||
static void
|
||||
mouse_toggle_mark (WPanel * panel)
|
||||
{
|
||||
do_mark_file (panel, 0);
|
||||
do_mark_file (panel, MARK_DONT_MOVE);
|
||||
mouse_marking = selection (panel)->f.marked;
|
||||
}
|
||||
|
||||
@ -3139,9 +3167,9 @@ static void
|
||||
mouse_set_mark (WPanel * panel)
|
||||
{
|
||||
if (mouse_marking && !(selection (panel)->f.marked))
|
||||
do_mark_file (panel, 0);
|
||||
do_mark_file (panel, MARK_DONT_MOVE);
|
||||
else if (!mouse_marking && (selection (panel)->f.marked))
|
||||
do_mark_file (panel, 0);
|
||||
do_mark_file (panel, MARK_DONT_MOVE);
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user