mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
* main.c (directory_history_list): Allow history command even
with just one entry - it's more intuitive.
This commit is contained in:
parent
738e33006b
commit
f95d276250
@ -1,5 +1,8 @@
|
|||||||
2003-02-18 Pavel Roskin <proski@gnu.org>
|
2003-02-18 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* main.c (directory_history_list): Allow history command even
|
||||||
|
with just one entry - it's more intuitive.
|
||||||
|
|
||||||
* util.c (list_append_unique): New function - add text to GList
|
* util.c (list_append_unique): New function - add text to GList
|
||||||
and remove duplicates.
|
and remove duplicates.
|
||||||
* main.c (directory_history_add): Use list_append_unique().
|
* main.c (directory_history_add): Use list_append_unique().
|
||||||
|
31
src/main.c
31
src/main.c
@ -833,23 +833,20 @@ void
|
|||||||
directory_history_list (WPanel *panel)
|
directory_history_list (WPanel *panel)
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
/* must be at least two to show a history */
|
|
||||||
if (panel->dir_history) {
|
if (!panel->dir_history)
|
||||||
if (panel->dir_history->prev || panel->dir_history->next) {
|
return;
|
||||||
s = show_hist (panel->dir_history, panel->widget.x,
|
|
||||||
panel->widget.y);
|
s = show_hist (panel->dir_history, panel->widget.x, panel->widget.y);
|
||||||
if (s) {
|
|
||||||
int r;
|
if (!s)
|
||||||
r = _do_panel_cd (panel, s, cd_exact);
|
return;
|
||||||
if (r)
|
|
||||||
directory_history_add (panel, panel->cwd);
|
if (_do_panel_cd (panel, s, cd_exact))
|
||||||
else
|
directory_history_add (panel, panel->cwd);
|
||||||
message (1, MSG_ERROR,
|
else
|
||||||
_("Cannot change directory"));
|
message (1, MSG_ERROR, _("Cannot change directory"));
|
||||||
g_free (s);
|
g_free (s);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SUBSHELL_SUPPORT
|
#ifdef HAVE_SUBSHELL_SUPPORT
|
||||||
|
Loading…
Reference in New Issue
Block a user