mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-10 21:42:00 +03:00
Comment change.
This commit is contained in:
parent
8148b4973c
commit
2eb1245290
@ -626,13 +626,19 @@ int edit_renew (WEdit * edit)
|
|||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns 1 on success, if returns 0, the edit struct would have been free'd */
|
/*
|
||||||
|
* Load a new file into the editor. If it fails, preserve the old file.
|
||||||
|
* To do it, allocate a new widget, initialize it and, if the new file
|
||||||
|
* was loaded, copy the data to the old widget.
|
||||||
|
* Return 1 on success, 0 on failure.
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
edit_reload (WEdit *edit, const char *filename)
|
edit_reload (WEdit *edit, const char *filename)
|
||||||
{
|
{
|
||||||
WEdit *e;
|
WEdit *e;
|
||||||
int lines = edit->num_widget_lines;
|
int lines = edit->num_widget_lines;
|
||||||
int columns = edit->num_widget_columns;
|
int columns = edit->num_widget_columns;
|
||||||
|
|
||||||
e = g_malloc0 (sizeof (WEdit));
|
e = g_malloc0 (sizeof (WEdit));
|
||||||
e->widget = edit->widget;
|
e->widget = edit->widget;
|
||||||
if (!edit_init (e, lines, columns, filename, 0)) {
|
if (!edit_init (e, lines, columns, filename, 0)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user