mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
(input_execute_cmd): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
964056fb65
commit
c08c90cd1b
@ -684,26 +684,30 @@ input_execute_cmd (WInput * in, unsigned long command)
|
||||
{
|
||||
cb_ret_t res = MSG_HANDLED;
|
||||
|
||||
/* a highlight command like shift-arrow */
|
||||
if (command == CK_MarkLeft || command == CK_MarkRight ||
|
||||
command == CK_MarkToWordBegin || command == CK_MarkToWordEnd ||
|
||||
command == CK_MarkToHome || command == CK_MarkToEnd)
|
||||
switch (command)
|
||||
{
|
||||
case CK_MarkLeft:
|
||||
case CK_MarkRight:
|
||||
case CK_MarkToWordBegin:
|
||||
case CK_MarkToWordEnd:
|
||||
case CK_MarkToHome:
|
||||
case CK_MarkToEnd:
|
||||
/* a highlight command like shift-arrow */
|
||||
if (in->mark < 0)
|
||||
{
|
||||
input_mark_cmd (in, FALSE); /* clear */
|
||||
input_mark_cmd (in, TRUE); /* marking on */
|
||||
}
|
||||
}
|
||||
|
||||
switch (command)
|
||||
{
|
||||
break;
|
||||
case CK_WordRight:
|
||||
case CK_WordLeft:
|
||||
case CK_Right:
|
||||
case CK_Left:
|
||||
if (in->mark >= 0)
|
||||
input_mark_cmd (in, FALSE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (command)
|
||||
@ -807,10 +811,20 @@ input_execute_cmd (WInput * in, unsigned long command)
|
||||
res = MSG_NOT_HANDLED;
|
||||
}
|
||||
|
||||
if (command != CK_MarkLeft && command != CK_MarkRight &&
|
||||
command != CK_MarkToWordBegin && command != CK_MarkToWordEnd &&
|
||||
command != CK_MarkToHome && command != CK_MarkToEnd)
|
||||
switch (command)
|
||||
{
|
||||
case CK_MarkLeft:
|
||||
case CK_MarkRight:
|
||||
case CK_MarkToWordBegin:
|
||||
case CK_MarkToWordEnd:
|
||||
case CK_MarkToHome:
|
||||
case CK_MarkToEnd:
|
||||
/* do nothing */
|
||||
break;
|
||||
default:
|
||||
in->mark = -1;
|
||||
break;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user