diff --git a/src/layout.c b/src/layout.c
index aa3f37e..7610d43 100644
a
|
b
|
set_display_type (int num, int type) |
913 | 913 | } |
914 | 914 | } |
915 | 915 | |
| 916 | /* Restoring saved path from panels.ini for nonlist panel */ |
| 917 | /* when it's first creation (for example view_info) */ |
| 918 | if (!old_widget && type != view_listing) { |
| 919 | char panel_dir[MC_MAXPATHLEN]; |
| 920 | mc_get_current_wd(panel_dir, sizeof(panel_dir)); |
| 921 | panels[num].last_saved_dir = g_strdup(panel_dir); |
| 922 | } |
| 923 | |
916 | 924 | switch (type){ |
917 | 925 | case view_listing: |
918 | 926 | new_widget = restore_into_right_dir_panel(num, old_widget); |
… |
… |
Widget *restore_into_right_dir_panel(int index, Widget *from_widget) |
1148 | 1156 | |
1149 | 1157 | return new_widget; |
1150 | 1158 | } |
| 1159 | |
| 1160 | /* Return working dir, if it's view_listing - cwd, |
| 1161 | but for other types - last_saved_dir |
| 1162 | */ |
| 1163 | const char *get_panel_dir_for(WPanel *widget) |
| 1164 | { |
| 1165 | int i; |
| 1166 | for (i = 0; i < MAX_VIEWS; i++) |
| 1167 | if ((WPanel *) get_panel_widget(i) == widget) |
| 1168 | break; |
| 1169 | |
| 1170 | if (i < MAX_VIEWS) { |
| 1171 | if (get_display_type(i) == view_listing) |
| 1172 | return ((WPanel *) get_panel_widget(i))->cwd; |
| 1173 | else |
| 1174 | return panels[i].last_saved_dir; |
| 1175 | } else |
| 1176 | return "."; |
| 1177 | } |
diff --git a/src/layout.h b/src/layout.h
index 6a68055..c07b714 100644
a
|
b
|
struct WPanel *get_other_panel (void); |
29 | 29 | |
30 | 30 | void save_panel_dir(int index); |
31 | 31 | Widget *restore_into_right_dir_panel(int index, Widget *from_widget); |
| 32 | const char *get_panel_dir_for(WPanel *widget); |
32 | 33 | |
33 | 34 | void set_hintbar (const char *str); |
34 | 35 | |
diff --git a/src/setup.c b/src/setup.c
index 2f1d8e0..ba331cb 100644
a
|
b
|
save_panel_types (void) |
353 | 353 | panel_save_setup (right_panel, right_panel->panel_name); |
354 | 354 | |
355 | 355 | mc_config_set_string(mc_panels_config, "Dirs" , "other_dir", |
356 | | get_other_type () == view_listing |
357 | | ? other_panel->cwd : "."); |
| 356 | get_panel_dir_for(other_panel)); |
358 | 357 | if (current_panel != NULL) |
359 | 358 | mc_config_set_string(mc_panels_config, "Dirs" , "current_is_left", |
360 | 359 | get_current_index () == 0 ? "1" : "0"); |