tweaks: elide a function that is called in just one place
Since commit b5f15cb5 from a year ago, there remains just one call of initialize_buffer_text().
Этот коммит содержится в:
родитель
527c6c1ca0
Коммит
368f1a1c9d
25
src/files.c
25
src/files.c
@ -88,11 +88,19 @@ void make_new_buffer(void)
|
|||||||
|
|
||||||
openfile->filename = mallocstrcpy(NULL, "");
|
openfile->filename = mallocstrcpy(NULL, "");
|
||||||
|
|
||||||
initialize_buffer_text();
|
openfile->filetop = make_new_node(NULL);
|
||||||
|
openfile->filetop->data = mallocstrcpy(NULL, "");
|
||||||
|
openfile->filebot = openfile->filetop;
|
||||||
|
|
||||||
|
openfile->current = openfile->filetop;
|
||||||
|
openfile->current_x = 0;
|
||||||
openfile->placewewant = 0;
|
openfile->placewewant = 0;
|
||||||
openfile->current_y = 0;
|
openfile->current_y = 0;
|
||||||
|
|
||||||
|
openfile->edittop = openfile->filetop;
|
||||||
|
openfile->firstcolumn = 0;
|
||||||
|
|
||||||
|
openfile->totsize = 0;
|
||||||
openfile->modified = FALSE;
|
openfile->modified = FALSE;
|
||||||
#ifdef ENABLE_WRAPPING
|
#ifdef ENABLE_WRAPPING
|
||||||
openfile->spillage_line = NULL;
|
openfile->spillage_line = NULL;
|
||||||
@ -116,21 +124,6 @@ void make_new_buffer(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the text and pointers of the current openfile struct. */
|
|
||||||
void initialize_buffer_text(void)
|
|
||||||
{
|
|
||||||
openfile->filetop = make_new_node(NULL);
|
|
||||||
openfile->filetop->data = mallocstrcpy(NULL, "");
|
|
||||||
|
|
||||||
openfile->filebot = openfile->filetop;
|
|
||||||
openfile->edittop = openfile->filetop;
|
|
||||||
openfile->current = openfile->filetop;
|
|
||||||
|
|
||||||
openfile->firstcolumn = 0;
|
|
||||||
openfile->current_x = 0;
|
|
||||||
openfile->totsize = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Mark the current file as modified if it isn't already, and then
|
/* Mark the current file as modified if it isn't already, and then
|
||||||
* update the titlebar to display the file's new status. */
|
* update the titlebar to display the file's new status. */
|
||||||
void set_modified(void)
|
void set_modified(void)
|
||||||
|
@ -263,7 +263,6 @@ void zap_text(void);
|
|||||||
void paste_text(void);
|
void paste_text(void);
|
||||||
|
|
||||||
/* Most functions in files.c. */
|
/* Most functions in files.c. */
|
||||||
void initialize_buffer_text(void);
|
|
||||||
void set_modified(void);
|
void set_modified(void);
|
||||||
bool open_buffer(const char *filename, bool new_buffer);
|
bool open_buffer(const char *filename, bool new_buffer);
|
||||||
#ifdef ENABLE_SPELLER
|
#ifdef ENABLE_SPELLER
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user