Esempio n. 1
0
File: view.c Progetto: lyuts/vifm
/* Handles view data reloading key. */
static void
cmd_R(key_info_t key_info, keys_info_t *keys_info)
{
	view_info_t new_vi;

	init_view_info(&new_vi);

	if(load_view_data(&new_vi, "File exploring reload", vi->filename) == 0)
	{
		replace_vi(vi, &new_vi);
		view_redraw();
	}
}
Esempio n. 2
0
void
enter_view_mode(FileView *view, int explore)
{
	char full_path[PATH_MAX];

	if(get_file_to_explore(curr_view, full_path, sizeof(full_path)) != 0)
	{
		show_error_msg("File exploring", "The file cannot be explored");
		return;
	}

	/* Either make use of abandoned view or prune it. */
	if(try_ressurect_abandoned(full_path, explore) == 0)
	{
		ui_views_update_titles();
		return;
	}

	pick_vi(explore);

	vi->view = view;
	if(load_view_data(vi, "File exploring", full_path, NOSILENT) != 0)
	{
		return;
	}

	vi->filename = strdup(full_path);

	vle_mode_set(VIEW_MODE, VMT_SECONDARY);

	if(explore)
	{
		vi->view = curr_view;
		curr_view->explore_mode = 1;
	}
	else
	{
		vi->view = other_view;
	}

	ui_views_update_titles();

	view_redraw();
}