Beispiel #1
0
static void ui_window_reload(UiWin *w, File *file) {
	UiCursesWin *win = (UiCursesWin*)w;
	win->file = file;
	win->sidebar_width = 0;
	view_reload(win->view, vis_file_text(file));
	ui_window_draw(w);
}
Beispiel #2
0
bool editor_window_reload(Win *win) {
	const char *filename = text_filename_get(win->file->text);
	/* can't reload unsaved file */
	if (!filename)
		return false;
	File *file = file_new(win->editor, filename);
	if (!file)
		return false;
	file_free(win->editor, win->file);
	win->file = file;
	view_reload(win->view, file->text);
	return true;
}