mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* screen.c (chdir_other_panel): Change behavior of Alt-O -
change the other panel to the current directory, put it to the listing mode if needed. Based on a patch from PLD Linux Distribution.
This commit is contained in:
parent
5dbffb96c2
commit
5d8071ceb4
@ -1,3 +1,10 @@
|
||||
2002-11-10 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* screen.c (chdir_other_panel): Change behavior of Alt-O -
|
||||
change the other panel to the current directory, put it to the
|
||||
listing mode if needed. Based on a patch from PLD Linux
|
||||
Distribution.
|
||||
|
||||
2002-11-06 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* myslang.h: Don't define ERR - it conflicts with sys/ucontext.h
|
||||
|
24
src/screen.c
24
src/screen.c
@ -1949,26 +1949,22 @@ do_enter (WPanel *panel)
|
||||
return do_enter_on_file_entry (selection (panel));
|
||||
}
|
||||
|
||||
/*
|
||||
* Make the current directory of the current panel also the current
|
||||
* directory of the other panel. Put the other panel to the listing
|
||||
* mode if needed. If the current panel is panelized, the other panel
|
||||
* doesn't become panelized.
|
||||
*/
|
||||
static void
|
||||
chdir_other_panel (WPanel *panel)
|
||||
{
|
||||
char *new_dir;
|
||||
|
||||
if (get_other_type () != view_listing)
|
||||
return;
|
||||
|
||||
if (!S_ISDIR (panel->dir.list [panel->selected].buf.st_mode))
|
||||
new_dir = concat_dir_and_file (panel->cwd, "..");
|
||||
else
|
||||
new_dir = concat_dir_and_file (panel->cwd, panel->dir.list [panel->selected].fname);
|
||||
if (get_other_type () != view_listing) {
|
||||
set_display_type (get_other_index (), view_listing);
|
||||
}
|
||||
|
||||
change_panel ();
|
||||
do_cd (new_dir, cd_exact);
|
||||
do_cd (panel->cwd, cd_exact);
|
||||
change_panel ();
|
||||
|
||||
move_down (panel);
|
||||
|
||||
g_free (new_dir);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user