tweaks: move a function to the file where it is used
Этот коммит содержится в:
родитель
9369af77ce
Коммит
2003413989
20
src/files.c
20
src/files.c
@ -642,6 +642,26 @@ void switch_to_next_buffer(void)
|
||||
redecorate_after_switch();
|
||||
}
|
||||
|
||||
/* Unlink a node from the rest of the circular list, and delete it. */
|
||||
void unlink_opennode(openfilestruct *fileptr)
|
||||
{
|
||||
if (fileptr == startfile)
|
||||
startfile = startfile->next;
|
||||
|
||||
fileptr->prev->next = fileptr->next;
|
||||
fileptr->next->prev = fileptr->prev;
|
||||
|
||||
free(fileptr->filename);
|
||||
free_lines(fileptr->filetop);
|
||||
#ifndef NANO_TINY
|
||||
free(fileptr->current_stat);
|
||||
free(fileptr->lock_filename);
|
||||
/* Free the undo stack. */
|
||||
discard_until(NULL, fileptr, TRUE);
|
||||
#endif
|
||||
free(fileptr);
|
||||
}
|
||||
|
||||
/* Remove the current buffer from the circular list of buffers. */
|
||||
void close_buffer(void)
|
||||
{
|
||||
|
22
src/nano.c
22
src/nano.c
@ -453,28 +453,6 @@ void copy_from_buffer(linestruct *somebuffer)
|
||||
ingraft_buffer(the_copy);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
/* Unlink a node from the rest of the circular list, and delete it. */
|
||||
void unlink_opennode(openfilestruct *fileptr)
|
||||
{
|
||||
if (fileptr == startfile)
|
||||
startfile = startfile->next;
|
||||
|
||||
fileptr->prev->next = fileptr->next;
|
||||
fileptr->next->prev = fileptr->prev;
|
||||
|
||||
free(fileptr->filename);
|
||||
free_lines(fileptr->filetop);
|
||||
#ifndef NANO_TINY
|
||||
free(fileptr->current_stat);
|
||||
free(fileptr->lock_filename);
|
||||
/* Free the undo stack. */
|
||||
discard_until(NULL, fileptr, TRUE);
|
||||
#endif
|
||||
free(fileptr);
|
||||
}
|
||||
#endif /* ENABLE_MULTIBUFFER */
|
||||
|
||||
/* Display a warning about a key disabled in view mode. */
|
||||
void print_view_warning(void)
|
||||
{
|
||||
|
@ -398,9 +398,6 @@ void unpartition_buffer();
|
||||
void extract(linestruct *top, size_t top_x, linestruct *bot, size_t bot_x);
|
||||
void ingraft_buffer(linestruct *somebuffer);
|
||||
void copy_from_buffer(linestruct *somebuffer);
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
void unlink_opennode(openfilestruct *fileptr);
|
||||
#endif
|
||||
void print_view_warning(void);
|
||||
void show_restricted_warning(void);
|
||||
#ifndef ENABLE_HELP
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user