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>
|
||||
|
||||
* 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
|
||||
and remove duplicates.
|
||||
* main.c (directory_history_add): Use list_append_unique().
|
||||
|
25
src/main.c
25
src/main.c
@ -833,24 +833,21 @@ void
|
||||
directory_history_list (WPanel *panel)
|
||||
{
|
||||
char *s;
|
||||
/* must be at least two to show a history */
|
||||
if (panel->dir_history) {
|
||||
if (panel->dir_history->prev || panel->dir_history->next) {
|
||||
s = show_hist (panel->dir_history, panel->widget.x,
|
||||
panel->widget.y);
|
||||
if (s) {
|
||||
int r;
|
||||
r = _do_panel_cd (panel, s, cd_exact);
|
||||
if (r)
|
||||
|
||||
if (!panel->dir_history)
|
||||
return;
|
||||
|
||||
s = show_hist (panel->dir_history, panel->widget.x, panel->widget.y);
|
||||
|
||||
if (!s)
|
||||
return;
|
||||
|
||||
if (_do_panel_cd (panel, s, cd_exact))
|
||||
directory_history_add (panel, panel->cwd);
|
||||
else
|
||||
message (1, MSG_ERROR,
|
||||
_("Cannot change directory"));
|
||||
message (1, MSG_ERROR, _("Cannot change directory"));
|
||||
g_free (s);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_SUBSHELL_SUPPORT
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user