mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
(edit_repeat_macro_cmd): refactoring.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
d650faf774
commit
fdd3a0013f
@ -1988,29 +1988,29 @@ edit_store_macro_cmd (WEdit * edit)
|
||||
gboolean
|
||||
edit_repeat_macro_cmd (WEdit * edit)
|
||||
{
|
||||
int i, j;
|
||||
gboolean ok;
|
||||
char *f;
|
||||
long count_repeat;
|
||||
char *error = NULL;
|
||||
long count_repeat = 0;
|
||||
|
||||
f = input_dialog (_("Repeat last commands"), _("Repeat times:"), MC_HISTORY_EDIT_REPEAT, NULL,
|
||||
INPUT_COMPLETE_NONE);
|
||||
if (f == NULL || *f == '\0')
|
||||
ok = (f != NULL && *f != '\0');
|
||||
|
||||
if (ok)
|
||||
{
|
||||
g_free (f);
|
||||
return FALSE;
|
||||
}
|
||||
char *error = NULL;
|
||||
|
||||
count_repeat = strtol (f, &error, 0);
|
||||
|
||||
if (*error != '\0')
|
||||
{
|
||||
g_free (f);
|
||||
return FALSE;
|
||||
ok = (*error == '\0');
|
||||
}
|
||||
|
||||
g_free (f);
|
||||
|
||||
if (ok)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
edit_push_undo_action (edit, KEY_PRESS + edit->start_display);
|
||||
edit->force |= REDRAW_PAGE;
|
||||
|
||||
@ -2019,7 +2019,9 @@ edit_repeat_macro_cmd (WEdit * edit)
|
||||
edit_execute_cmd (edit, record_macro_buf[i].action, record_macro_buf[i].ch);
|
||||
|
||||
edit_update_screen (edit);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user