Skip to content

Commit 6a66843

Browse files
committed
Merge branch '4637_reload_panels'
* 4637_reload_panels: Ticket #4637: panels not refreshed after editing file with internal editor.
2 parents 420ee02 + f80dc2b commit 6a66843

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

lib/widget/dialog-switch.c

+21-14
Original file line numberDiff line numberDiff line change
@@ -266,28 +266,35 @@ dialog_switch_list (void)
266266
int
267267
dialog_switch_process_pending (void)
268268
{
269+
WDialog *h = DIALOG (mc_current->data);
269270
int ret = 0;
270271

271-
while (dialog_switch_pending)
272+
if (!dialog_switch_pending)
272273
{
273-
WDialog *h = DIALOG (mc_current->data);
274-
Widget *wh = WIDGET (h);
275-
276-
dialog_switch_pending = FALSE;
277-
widget_set_state (wh, WST_SUSPENDED, TRUE);
278-
ret = dlg_run (h);
279-
if (widget_get_state (wh, WST_CLOSED))
274+
// return to panels and reload them forced
275+
if (mc_global.mc_run_mode == MC_RUN_FULL && h == filemanager)
276+
mc_event_raise (MCEVENT_GROUP_FILEMANAGER, "update_panels", NULL);
277+
}
278+
else
279+
while (dialog_switch_pending)
280280
{
281-
widget_destroy (wh);
281+
Widget *wh = WIDGET (h);
282282

283-
// return to panels
284-
if (mc_global.mc_run_mode == MC_RUN_FULL)
283+
dialog_switch_pending = FALSE;
284+
widget_set_state (wh, WST_SUSPENDED, TRUE);
285+
ret = dlg_run (h);
286+
if (widget_get_state (wh, WST_CLOSED))
285287
{
286-
mc_current = g_list_find (mc_dialogs, filemanager);
287-
mc_event_raise (MCEVENT_GROUP_FILEMANAGER, "update_panels", NULL);
288+
widget_destroy (wh);
289+
290+
// return to panels
291+
if (mc_global.mc_run_mode == MC_RUN_FULL)
292+
{
293+
mc_current = g_list_find (mc_dialogs, filemanager);
294+
mc_event_raise (MCEVENT_GROUP_FILEMANAGER, "update_panels", NULL);
295+
}
288296
}
289297
}
290-
}
291298

292299
repaint_screen ();
293300

0 commit comments

Comments
 (0)