mirror of https://github.com/MidnightCommander/mc
Ticket #3420: (dview_goto_cmd): use INPUT_LAST_TEXT instead of static variable.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
e9db0a0c12
commit
89a79cabe4
|
@ -2913,21 +2913,21 @@ dview_edit (WDiff * dview, diff_place_t ord)
|
|||
static void
|
||||
dview_goto_cmd (WDiff * dview, diff_place_t ord)
|
||||
{
|
||||
static gboolean first_run = TRUE;
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
static const char *title[2] = {
|
||||
N_("Goto line (left)"),
|
||||
N_("Goto line (right)")
|
||||
};
|
||||
/* *INDENT-ON* */
|
||||
static char prev[256];
|
||||
/* XXX some statics here, to be remembered between runs */
|
||||
|
||||
int newline;
|
||||
char *input;
|
||||
|
||||
input =
|
||||
input_dialog (_(title[ord]), _("Enter line:"), MC_HISTORY_YDIFF_GOTO_LINE, prev,
|
||||
INPUT_COMPLETE_NONE);
|
||||
input_dialog (_(title[ord]), _("Enter line:"), MC_HISTORY_YDIFF_GOTO_LINE,
|
||||
first_run ? NULL : INPUT_LAST_TEXT, INPUT_COMPLETE_NONE);
|
||||
if (input != NULL)
|
||||
{
|
||||
const char *s = input;
|
||||
|
@ -2948,10 +2948,11 @@ dview_goto_cmd (WDiff * dview, diff_place_t ord)
|
|||
}
|
||||
}
|
||||
dview->skip_rows = dview->search.last_accessed_num_line = (ssize_t) i;
|
||||
g_snprintf (prev, sizeof (prev), "%d", newline);
|
||||
}
|
||||
g_free (input);
|
||||
}
|
||||
|
||||
first_run = FALSE;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
|
Loading…
Reference in New Issue